From dbf16c8302b69bdd62f1ada0e6d832da7d2c3efa Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Mon, 7 Mar 2016 14:59:29 -0800 Subject: [PATCH] Fix veth leak in overlay driver - Because of the lazy logic in Leave(), the overlay veth end is not moved from the sandbox to the host network namspace until the last endpoint leaves. We cannot rely on this logic to clear the veth pairs, because on last endpoint leave we have no reference to the other N-1 veth names. - The fix is to delete the container veth end on endpoint delete. This anyways deletes both veth ends, regardless they are in different namespaces. Signed-off-by: Alessandro Boch --- libnetwork/drivers/overlay/joinleave.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnetwork/drivers/overlay/joinleave.go b/libnetwork/drivers/overlay/joinleave.go index d87c032dfc..5b6792da6b 100644 --- a/libnetwork/drivers/overlay/joinleave.go +++ b/libnetwork/drivers/overlay/joinleave.go @@ -54,7 +54,7 @@ func (d *driver) Join(nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, return err } - ep.ifName = overlayIfName + ep.ifName = containerIfName // Set the container interface and its peer MTU to 1450 to allow // for 50 bytes vxlan encap (inner eth header(14) + outer IP(20) +