diff --git a/libnetwork/osl/neigh_linux.go b/libnetwork/osl/neigh_linux.go index e875f6ab64..c881f5df48 100644 --- a/libnetwork/osl/neigh_linux.go +++ b/libnetwork/osl/neigh_linux.go @@ -147,7 +147,9 @@ func (n *networkNamespace) AddNeighbor(dstIP net.IP, dstMac net.HardwareAddr, op return fmt.Errorf("could not add neighbor entry: %v", err) } + n.Lock() n.neighbors = append(n.neighbors, nh) + n.Unlock() return nil }