Skip to content

Commit

Permalink
cni: Try to enable IPv6 only if necessary
Browse files Browse the repository at this point in the history
Fixes: cilium#9393

Signed-off-by: Michal Rostecki <[email protected]>
  • Loading branch information
vadorovsky authored and tgraf committed Oct 25, 2019
1 parent e943601 commit a49bf84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/cilium-cni/cilium-cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,10 @@ func cmdAdd(args *skel.CmdArgs) (err error) {

var macAddrStr string
if err = netNs.Do(func(_ ns.NetNS) error {
if err := sysctl.Disable("net.ipv6.conf.all.disable_ipv6"); err != nil {
logger.WithError(err).Warn("unable to enable ipv6 on all interfaces")
if ipv6IsEnabled(ipam) {
if err := sysctl.Disable("net.ipv6.conf.all.disable_ipv6"); err != nil {
logger.WithError(err).Warn("unable to enable ipv6 on all interfaces")
}
}
macAddrStr, err = configureIface(ipam, args.IfName, &state)
return err
Expand Down

0 comments on commit a49bf84

Please sign in to comment.