Skip to content

Commit 1b072be

Browse files
committed
fix
1 parent 35b5f32 commit 1b072be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/bridge/setup_ipv6.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,17 @@ func setupNDPProxying(config *networkConfiguration, i *bridgeInterface) error {
132132
logrus.Warnf("Unable to enable NDP default proxying: %v", err)
133133
}
134134
}
135-
135+
136136
// Get interface with proxy_ndp enabled.
137137
ndpProxyConfPath := fmt.Sprintf("/proc/sys/net/ipv6/conf/%s/proxy_ndp", config.NDPProxyInterface)
138+
if err != nil {
139+
return fmt.Errorf("Unable to enable NDP proxying for interface %s: %v", config.NDPProxyInterface,err)
140+
}
138141
// Enable NDP proxying only if it is not already enabled
139-
if err := ioutil.WriteFile(ndpProxyConfPath, []byte{'1', '\n'}, ndpProxyConfPerm); err != nil {
140-
logrus.Warnf("Unable to enable NDP proxying for interface %s: %v", config.NDPProxyInterface,err)
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)
145+
}
141146
}
142147

143148
return nil

0 commit comments

Comments
 (0)