diff --git a/libnetwork/osl/interface_linux.go b/libnetwork/osl/interface_linux.go index b00e9e3a66..baa0923eab 100644 --- a/libnetwork/osl/interface_linux.go +++ b/libnetwork/osl/interface_linux.go @@ -281,6 +281,7 @@ func (n *Namespace) RemoveInterface(i *Interface) error { return err } + // TODO(aker): Why are we doing this? This would fail if the initial interface set up failed before the "dest interface" was moved into its own namespace; see https://github.com/moby/moby/pull/46315/commits/108595c2fe852a5264b78e96f9e63cda284990a6#r1331253578 err = nlh.LinkSetName(iface, i.SrcName()) if err != nil { log.G(context.TODO()).Debugf("LinkSetName failed for interface %s: %v", i.SrcName(), err) @@ -294,6 +295,7 @@ func (n *Namespace) RemoveInterface(i *Interface) error { } } else if !isDefault { // Move the network interface to caller namespace. + // TODO(aker): What's this really doing? There are no calls to LinkDel in this package: is this code really used? (Interface.Remove() has 3 callers); see https://github.com/moby/moby/pull/46315/commits/108595c2fe852a5264b78e96f9e63cda284990a6#r1331265335 if err := nlh.LinkSetNsFd(iface, ns.ParseHandlerInt()); err != nil { log.G(context.TODO()).Debugf("LinkSetNsFd failed for interface %s: %v", i.SrcName(), err) return err @@ -309,6 +311,7 @@ func (n *Namespace) RemoveInterface(i *Interface) error { } n.mu.Unlock() + // TODO(aker): This function will disable IPv6 on lo interface if the removed interface was the last one offering IPv6 connectivity. That's a weird behavior, and shouldn't be hiding this deep down in this function. n.checkLoV6() return nil } diff --git a/libnetwork/osl/namespace_linux.go b/libnetwork/osl/namespace_linux.go index 7a8c2d1158..73270662b7 100644 --- a/libnetwork/osl/namespace_linux.go +++ b/libnetwork/osl/namespace_linux.go @@ -304,6 +304,8 @@ func createNamespaceFile(path string) error { // wait for garbage collection to complete if it is in progress // before trying to create the file. + // + // TODO(aker): This garbage-collection was for a kernel bug in kernels 3.18-4.0.1: is this still needed on current kernels (and on kernel 3.10)? see https://github.com/moby/moby/pull/46315/commits/c0a6beba8e61d4019e1806d5241ba22007072ca2#r1331327103 gpmWg.Wait() f, err := os.Create(path)