mirror of
https://github.com/moby/moby.git
synced 2026-08-03 22:51:03 +00:00
Fix bug in DeleteNeighbor
- stop iterating after changing the list reference Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
@@ -80,6 +80,7 @@ func (n *networkNamespace) DeleteNeighbor(dstIP net.IP, dstMac net.HardwareAddr,
|
||||
for i, nh := range n.neighbors {
|
||||
if nh.dstIP.Equal(dstIP) && bytes.Equal(nh.dstMac, dstMac) {
|
||||
n.neighbors = append(n.neighbors[:i], n.neighbors[i+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
n.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user