aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-05-01 17:08:20 -0700
committerBen Pfaff <blp@nicira.com>2013-05-02 10:13:09 -0700
commit8ac6e0e15dafd1b41001fdc52ea00cc42906d5a9 (patch)
tree7c4e88857ab022eeb94da18b94624a0c56f24aa7 /lib
parentd4c5b6423aa063eaf296ec8cf7d1a50197863cec (diff)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpif-linux.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 63cbaa7b..a1a00cd5 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -337,6 +337,7 @@ add_channel(struct dpif_linux *dpif, uint32_t port_no, struct nl_sock *sock)
return errno;
}
+ nl_sock_destroy(dpif->channels[port_no].sock);
dpif->channels[port_no].sock = sock;
dpif->channels[port_no].last_poll = LLONG_MIN;