Skip to content

Commit 8450e31

Browse files
author
Aritra Basu
committed
vpp-manager: set uplink admin-up only after RA is disabled
Move InterfaceAdminUp() for the uplink interface to after DisableIP6RouterAdvertisements(). Previously, the uplink was brought admin-up immediately after creation and then configured with IPv6 enable, RA suppress, CNAT, VRF, addresses, and routes. This left a window where the interface was up with RA processing still active, allowing VPP to process Router Advertisements from the wire and potentially install unwanted SLAAC addresses or default routes before the intended configuration was in place. Signed-off-by: Aritra Basu <aritrbas@cisco.com>
1 parent 5cb69df commit 8450e31

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

vpp-manager/vpp_runner.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,13 @@ func (v *VppRunner) configureVppUplinkInterface(
487487
return errors.Wrap(err, "Error disabling ipv6 RA on uplink interface")
488488
}
489489

490+
// Keep the interface admin-down until RA suppression is installed, then
491+
// bring it up before programming the rest of IPv6/L3 state.
492+
err = v.vpp.Retry(2*time.Second, 10, v.vpp.InterfaceAdminUp, ifSpec.SwIfIndex)
493+
if err != nil {
494+
return errors.Wrap(err, "Error setting uplink interface up")
495+
}
496+
490497
err = v.vpp.CnatEnableFeatures(ifSpec.SwIfIndex)
491498
if err != nil {
492499
return errors.Wrap(err, "Error configuring NAT on uplink interface")
@@ -1008,15 +1015,7 @@ func (v *VppRunner) runVpp() (err error) {
10081015
return errors.Wrap(err, "Error creating uplink interface")
10091016
}
10101017

1011-
// Data interface configuration
1012-
err = v.vpp.Retry(2*time.Second, 10, v.vpp.InterfaceAdminUp, v.params.UplinksSpecs[idx].SwIfIndex)
1013-
if err != nil {
1014-
terminateVpp("Error setting uplink interface up: %v", err)
1015-
v.vpp.Close()
1016-
<-vppDeadChan
1017-
return errors.Wrap(err, "Error setting uplink interface up")
1018-
}
1019-
1018+
// Configure uplink and only bring it up after RA suppression is set.
10201019
err = v.configureVppUplinkInterface(v.uplinkDriver[idx], v.conf[idx], v.params.UplinksSpecs[idx])
10211020

10221021
if err != nil {

0 commit comments

Comments
 (0)