pedit: Fix EncodeActions to add TcGen for pedit action

TcGen was missing in pedit action and the kernel cannont correctly process pedit action.

Signed-off-by: Chen Tang <tangchen.1@bytedance.com>
This commit is contained in:
tc
2025-03-04 15:19:27 +08:00
committed by Alessandro Boch
parent 9b61d26766
commit 31feb1b4c7

View File

@@ -752,6 +752,7 @@ func EncodeActions(attr *nl.RtAttr, actions []Action) error {
table := attr.AddRtAttr(tabIndex, nil)
tabIndex++
pedit := nl.TcPedit{}
toTcGen(action.Attrs(), &pedit.Sel.TcGen)
if action.SrcMacAddr != nil {
pedit.SetEthSrc(action.SrcMacAddr)
}