From 3559b2913fa68c994e8c727e0408574e2fc408fe Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Wed, 19 Oct 2022 05:24:30 -0500 Subject: [PATCH] Disable IPv6 RA from VPP for tunnel ip. Signed-off-by: Ed Warnicke --- internal/imports/imports_linux.go | 1 + internal/vppinit/vppinit.go | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/internal/imports/imports_linux.go b/internal/imports/imports_linux.go index 192ac7f9..5255ff3a 100644 --- a/internal/imports/imports_linux.go +++ b/internal/imports/imports_linux.go @@ -17,6 +17,7 @@ import ( _ "github.com/edwarnicke/govpp/binapi/interface" _ "github.com/edwarnicke/govpp/binapi/interface_types" _ "github.com/edwarnicke/govpp/binapi/ip" + _ "github.com/edwarnicke/govpp/binapi/ip6_nd" _ "github.com/edwarnicke/govpp/binapi/ip_neighbor" _ "github.com/edwarnicke/govpp/binapi/ip_types" _ "github.com/edwarnicke/grpcfd" diff --git a/internal/vppinit/vppinit.go b/internal/vppinit/vppinit.go index 6c1de7fd..9490da68 100644 --- a/internal/vppinit/vppinit.go +++ b/internal/vppinit/vppinit.go @@ -31,6 +31,7 @@ import ( interfaces "github.com/edwarnicke/govpp/binapi/interface" "github.com/edwarnicke/govpp/binapi/interface_types" "github.com/edwarnicke/govpp/binapi/ip" + "github.com/edwarnicke/govpp/binapi/ip6_nd" "github.com/edwarnicke/govpp/binapi/ip_neighbor" "github.com/pkg/errors" "github.com/vishvananda/netlink" @@ -92,6 +93,22 @@ func LinkToAfPacket(ctx context.Context, vppConn api.Connection, tunnelIP net.IP return nil, err } + now := time.Now() + if tunnelIP.To4() == nil { + _, err = ip6_nd.NewServiceClient(vppConn).IP6ndSendRouterSolicitation(ctx, &ip6_nd.IP6ndSendRouterSolicitation{ + SwIfIndex: swIfIndex, + Stop: true, + }) + if err != nil { + return nil, err + } + log.FromContext(ctx). + WithField("swIfIndex", swIfIndex). + WithField("stop", true). + WithField("duration", time.Since(now)). + WithField("vppapi", "IP6ndSendRouterSolicitation").Debug("completed") + } + if mtuErr := setMtu(ctx, vppConn, link, swIfIndex); err != nil { return nil, mtuErr } @@ -100,7 +117,7 @@ func LinkToAfPacket(ctx context.Context, vppConn api.Connection, tunnelIP net.IP return nil, aclErr } - now := time.Now() + now = time.Now() _, err = interfaces.NewServiceClient(vppConn).SwInterfaceSetFlags(ctx, &interfaces.SwInterfaceSetFlags{ SwIfIndex: swIfIndex, Flags: interface_types.IF_STATUS_API_FLAG_ADMIN_UP,