From: Jesse Gross Date: Sat, 19 Nov 2011 22:26:02 +0000 (-0800) Subject: datapath: Always notify in initial namespace for port deletions. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69cd5b735977ee674515b52f2210c34aed0e7ccc;p=openvswitch datapath: Always notify in initial namespace for port deletions. We currently notify for port deletions in the namespace of the device that was deleted. In general this should be initial namespace because that's the only place where we look but it's possible that the device was moved after being attached. However, it's not semantically correct because we really care about the namespace of the userspace process, not that of the device. This switches to genlmsg_multicast() which always uses the initial namespace and seems more appropriate anyways. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/dp_notify.c b/datapath/dp_notify.c index 122b2fa9..415e83b2 100644 --- a/datapath/dp_notify.c +++ b/datapath/dp_notify.c @@ -43,21 +43,20 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event, switch (event) { case NETDEV_UNREGISTER: if (!is_internal_dev(dev)) { - struct sk_buff *reply; + struct sk_buff *notify; - reply = ovs_vport_cmd_build_info(vport, 0, 0, - OVS_VPORT_CMD_DEL); + notify = ovs_vport_cmd_build_info(vport, 0, 0, + OVS_VPORT_CMD_DEL); dp_detach_port(vport); - if (IS_ERR(reply)) { + if (IS_ERR(notify)) { netlink_set_err(INIT_NET_GENL_SOCK, 0, dp_vport_multicast_group.id, - PTR_ERR(reply)); + PTR_ERR(notify)); break; } - genl_notify(reply, dev_net(dev), 0, - dp_vport_multicast_group.id, NULL, - GFP_KERNEL); + genlmsg_multicast(notify, 0, dp_vport_multicast_group.id, + GFP_KERNEL); } break;