From e9afc0be574f0471f856ea33d382c1a5f09fd908 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Mon, 14 Nov 2016 21:41:22 -0800 Subject: [PATCH] Fix bug in DeleteNeighbor - stop iterating after changing the list reference Signed-off-by: Alessandro Boch --- osl/neigh_linux.go | 1 + 1 file changed, 1 insertion(+) diff --git a/osl/neigh_linux.go b/osl/neigh_linux.go index a7669a111b..673522ad63 100644 --- a/osl/neigh_linux.go +++ b/osl/neigh_linux.go @@ -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()