@@ -20,7 +20,6 @@ const (
2020 ipv6ForwardConfAll = "/proc/sys/net/ipv6/conf/all/forwarding"
2121 ndpProxyConfPerm = 0644
2222 ndpProxyConfDefault = "/proc/sys/net/ipv6/conf/default/proxy_ndp"
23- ndpProxyConfAll = "/proc/sys/net/ipv6/conf/all/proxy_ndp"
2423)
2524
2625func init () {
@@ -134,15 +133,15 @@ func setupNDPProxying(config *networkConfiguration, i *bridgeInterface) error {
134133 }
135134 }
136135
137- // Get current NDP all proxying setup
138- ndpProxyDataAll , err := ioutil . ReadFile ( ndpProxyConfAll )
136+ // Get interface with proxy_ndp enabled.
137+ ndpProxyConfPath := fmt . Sprintf ( "/proc/sys/net/ipv6/conf/%s/proxy_ndp" , config . NDPProxyInterface )
139138 if err != nil {
140- return fmt .Errorf ("Cannot read NDP all proxying setup : %v" , err )
139+ return fmt .Errorf ("Unable to enable NDP proxying for interface %s : %v" , config . NDPProxyInterface , err )
141140 }
142- // Enable NDP all proxying only if it is not already enabled
143- if ndpProxyDataAll [0 ] != '1' {
144- if err := ioutil .WriteFile (ndpProxyConfAll , []byte {'1' , '\n' }, ndpProxyConfPerm ); err != nil {
145- logrus .Warnf ("Unable to enable NDP all proxying: %v" , err )
141+ // Enable NDP proxying only if it is not already enabled
142+ if ndpProxyConfPerm [0 ] != '1' {
143+ if err := ioutil .WriteFile (ndpProxyConfPath , []byte {'1' , '\n' }, ndpProxyConfPerm ); err != nil {
144+ logrus .Warnf ("Unable to enable NDP proxying for interface %s : %v" , config . NDPProxyInterface , err )
146145 }
147146 }
148147
0 commit comments