dpif-linux: Close channel Netlink sockets when a port number gets recycled.
authorBen Pfaff <blp@nicira.com>
Thu, 2 May 2013 00:08:20 +0000 (17:08 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 2 May 2013 17:10:42 +0000 (10:10 -0700)
commit48f6fbe1972a4ab6d47e87913fcf537125e7dcb4
tree33fb03e544107c0c90a3b1ac16855f3558337e2a
parent12d7685905026b090868056c4d19ee866b6dbe5d
dpif-linux: Close channel Netlink sockets when a port number gets recycled.

When ovs-vswitchd deletes a port with dpif_linux_port_del(), that function
uses del_channel() to delete the corresponding channel, including closing
its Netlink socket fd.  However, if the vport gets removed by some other
process (e.g. "ip link delete" for veths) then this function never gets
called and thus the channel never gets deleted.

This commit partially fixes the problem.  Now, if a port number gets
reused, add_channel() closes the old Netlink socket assigned to that port
before it installs the new one.

Bug #16784.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/dpif-linux.c