You need to sign in or sign up before continuing.
Commit 0cfd09e1 authored by Bryan Boreham's avatar Bryan Boreham Committed by Bryan Boreham

Abandon setting hairpin mode if finding the peer interface fails

Instead of setting it on every bridge-connected interface which may have unwanted effects on unrelated things installed on the machine.
parent c3a2cc53
......@@ -58,8 +58,7 @@ func setUpContainerInternal(containerInterfaceName, containerDesc string, nsente
e := exec.New()
hostIfName, err := findPairInterfaceOfContainerInterface(e, containerInterfaceName, containerDesc, nsenterArgs)
if err != nil {
glog.Infof("Unable to find pair interface, setting up all interfaces: %v", err)
return setUpAllInterfaces()
return err
}
return setUpInterface(hostIfName)
}
......@@ -95,17 +94,6 @@ func findPairInterfaceOfContainerInterface(e exec.Interface, containerInterfaceN
return iface.Name, nil
}
func setUpAllInterfaces() error {
interfaces, err := net.Interfaces()
if err != nil {
return err
}
for _, netIf := range interfaces {
setUpInterface(netIf.Name) // ignore errors
}
return nil
}
func setUpInterface(ifName string) error {
glog.V(3).Infof("Enabling hairpin on interface %s", ifName)
ifPath := path.Join(sysfsNetPath, ifName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment