Skip to content

Commit

Permalink
Disable IPv6 RA from VPP for tunnel ip.
Browse files Browse the repository at this point in the history
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
  • Loading branch information
edwarnicke committed Oct 19, 2022
1 parent a575fe0 commit 3559b29
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion internal/vppinit/vppinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand All @@ -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,
Expand Down

0 comments on commit 3559b29

Please sign in to comment.