Skip to content

Commit

Permalink
Change af_packet API version
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
  • Loading branch information
glazychev-art committed Feb 22, 2023
1 parent b23aef5 commit 341fad3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 341fad3

Please sign in to comment.