datapath: Always notify in initial namespace for port deletions.
authorJesse Gross <jesse@nicira.com>
Sat, 19 Nov 2011 22:26:02 +0000 (14:26 -0800)
committerJesse Gross <jesse@nicira.com>
Mon, 21 Nov 2011 18:29:49 +0000 (10:29 -0800)
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 <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/dp_notify.c

index 122b2fa989a9838f9d3940a6afae64c8a96c77c1..415e83b22c45dacd80ab12deea7dcd13f62efe9c 100644 (file)
@@ -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;