Skip to content

Commit 7a12bbe

Browse files
committed
libn/d/overlay: delete FDB entry from AF_BRIDGE
Starting with commit 0d6e7cd DeleteNeighbor() needs to be called with the same options as the AddNeighbor() call that created the neighbor entry. The calls in peerdb were modified incorrectly, resulting in the deletes failing and leaking neighbor entries. Fix up the DeleteNeighbor calls so that the FDB entry is deleted from the FDB instead of the neighbor table, and the neighbor is deleted from the neighbor table instead of the FDB. Signed-off-by: Cory Snider <[email protected]>
1 parent bd965df commit 7a12bbe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libnetwork/drivers/overlay/peerdb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ func (d *driver) peerDeleteOp(nid, eid string, peerIP netip.Prefix, peerMac net.
311311
return fmt.Errorf("could not find the subnet %q in network %q", peerIP.String(), n.id)
312312
}
313313
// Remove fdb entry to the bridge for the peer mac
314-
if err := sbox.DeleteNeighbor(vtep.AsSlice(), peerMac, osl.WithLinkName(s.vxlanName)); err != nil {
314+
if err := sbox.DeleteNeighbor(vtep.AsSlice(), peerMac, osl.WithLinkName(s.vxlanName), osl.WithFamily(syscall.AF_BRIDGE)); err != nil {
315315
if _, ok := err.(osl.NeighborSearchError); ok && dbEntries > 0 {
316316
// We fall in here if there is a transient state and if the neighbor that is being deleted
317317
// was never been configured into the kernel (we allow only 1 configuration at the time per <ip,mac> mapping)
@@ -321,7 +321,7 @@ func (d *driver) peerDeleteOp(nid, eid string, peerIP netip.Prefix, peerMac net.
321321
}
322322

323323
// Delete neighbor entry for the peer IP
324-
if err := sbox.DeleteNeighbor(peerIP.Addr().AsSlice(), peerMac, osl.WithLinkName(s.vxlanName), osl.WithFamily(syscall.AF_BRIDGE)); err != nil {
324+
if err := sbox.DeleteNeighbor(peerIP.Addr().AsSlice(), peerMac, osl.WithLinkName(s.vxlanName)); err != nil {
325325
return fmt.Errorf("could not delete neighbor entry for nid:%s eid:%s into the sandbox:%v", nid, eid, err)
326326
}
327327
}

0 commit comments

Comments
 (0)