From 258fefd92fc2f451f7f0248c85542b0ee40c7302 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 2 Mar 2018 13:05:12 -0600 Subject: netlink: Use nl_pid 0 to play nice with others. While the netlink field is named nl_pid, and typically contains a process id, setting it to a pid value directly prevents other modules from also using a netlink socket. On the other hand, setting it to 0 allows multiple modules to use a netlink socket by letting the kernel assign the nl_pid a value. This allows the verito tap code to interact nicely with the router plugin's librtnl after, say, tap-inject has been enabled. Change-Id: I9771929f34d15497a5f7b8c5fd78dac28e31383b Signed-off-by: Jon Loeliger --- src/vnet/devices/netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vnet') diff --git a/src/vnet/devices/netlink.c b/src/vnet/devices/netlink.c index 8346b1c77ea..1d44f287bdc 100644 --- a/src/vnet/devices/netlink.c +++ b/src/vnet/devices/netlink.c @@ -76,7 +76,7 @@ vnet_netlink_msg_send (vnet_netlink_msg_t * m) return clib_error_return_unix (0, "socket(AF_NETLINK)"); ra.nl_family = AF_NETLINK; - ra.nl_pid = getpid (); + ra.nl_pid = 0; if ((bind (sock, (struct sockaddr *) &ra, sizeof (ra))) == -1) { -- cgit 1.2.3-korg