Skip to content

Commit

Permalink
Merge pull request #879 from lmm/automated-cherry-pick-of-#878-upstre…
Browse files Browse the repository at this point in the history
…am-release-v3.14

Automated cherry pick of #878: Disable accept_ra for the host veth
  • Loading branch information
caseydavenport authored May 22, 2020
2 parents 418f8a8 + 625b991 commit 3fef1de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/dataplane/linux/linux_dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (d *linuxDataplane) DoNetworking(
return "", "", err
}

err = configureSysctls(hostVethName, hasIPv4, hasIPv6)
err = d.configureSysctls(hostVethName, hasIPv4, hasIPv6)
if err != nil {
return "", "", fmt.Errorf("error configuring sysctls for interface: %s, error: %s", hostVethName, err)
}
Expand Down Expand Up @@ -317,7 +317,7 @@ func SetupRoutes(hostVeth netlink.Link, result *current.Result) error {
}

// configureSysctls configures necessary sysctls required for the host side of the veth pair for IPv4 and/or IPv6.
func configureSysctls(hostVethName string, hasIPv4, hasIPv6 bool) error {
func (d *linuxDataplane) configureSysctls(hostVethName string, hasIPv4, hasIPv6 bool) error {
var err error

if hasIPv4 {
Expand Down Expand Up @@ -365,6 +365,10 @@ func configureSysctls(hostVethName string, hasIPv4, hasIPv6 bool) error {
}
}

if err = writeProcSys(fmt.Sprintf("/proc/sys/net/ipv6/conf/%s/accept_ra", hostVethName), "0"); err != nil {
d.logger.Warnf("failed to set net.ipv6.conf.%s.accept_ra=0: %s", hostVethName, err)
}

return nil
}

Expand Down

0 comments on commit 3fef1de

Please sign in to comment.