From 341fad3d5b8ad1d21881ba823a2049fdd6aa4ba5 Mon Sep 17 00:00:00 2001 From: Artem Glazychev Date: Wed, 22 Feb 2023 18:27:18 +0700 Subject: [PATCH] Change af_packet API version Signed-off-by: Artem Glazychev --- .../mechanisms/kernel/kernelvethpair/afpacket/common.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go b/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go index e82277f0..58382d5d 100644 --- a/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go +++ b/pkg/networkservice/mechanisms/kernel/kernelvethpair/afpacket/common.go @@ -49,17 +49,19 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co return errors.New("peer link not found") } now := time.Now() - rsp, err := af_packet.NewServiceClient(vppConn).AfPacketCreate(ctx, &af_packet.AfPacketCreate{ + rsp, err := af_packet.NewServiceClient(vppConn).AfPacketCreateV3(ctx, &af_packet.AfPacketCreateV3{ + Mode: af_packet.AF_PACKET_API_MODE_ETHERNET, HostIfName: peerLink.Attrs().Name, HwAddr: types.ToVppMacAddress(&peerLink.Attrs().HardwareAddr), + Flags: af_packet.AF_PACKET_API_FLAG_VERSION_2, }) if err != nil { - return errors.Wrap(err, "vppapi AfPacketCreate returned error") + return errors.Wrap(err, "vppapi AfPacketCreateV3 returned error") } log.FromContext(ctx). WithField("swIfIndex", rsp.SwIfIndex). WithField("duration", time.Since(now)). - WithField("vppapi", "AfPacketCreate").Debug("completed") + WithField("vppapi", "AfPacketCreateV3").Debug("completed") ifindex.Store(ctx, isClient, rsp.SwIfIndex) now = time.Now()