classifier: Change cls_rule_set_nd_target() to take a pointer.
[openvswitch] / datapath / dp_notify.c
index 8c54d68315a8d43696cff4c2dbea9c7de1dfe3bb..7b3b219ac2a97fcd1f0f7a8b4a2826e7231b01a4 100644 (file)
@@ -9,6 +9,7 @@
 /* Handle changes to managed devices */
 
 #include <linux/netdevice.h>
+#include <net/genetlink.h>
 
 #include "datapath.h"
 #include "vport-internal_dev.h"
@@ -33,12 +34,27 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
 
        switch (event) {
        case NETDEV_UNREGISTER:
-               if (!is_internal_dev(dev))
+               if (!is_internal_dev(dev)) {
+                       struct sk_buff *reply;
+
                        dp_detach_port(vport);
+                       reply = ovs_vport_cmd_build_info(vport, 0, 0,
+                                                        OVS_VPORT_CMD_DEL);
+                       if (IS_ERR(reply)) {
+                               netlink_set_err(INIT_NET_GENL_SOCK, 0,
+                                               dp_vport_multicast_group.id,
+                                               PTR_ERR(reply));
+                               break;
+                       }
+
+                       genl_notify(reply, dev_net(dev), 0,
+                                   dp_vport_multicast_group.id, NULL,
+                                   GFP_KERNEL);
+               }
                break;
 
        case NETDEV_CHANGENAME:
-               if (vport->port_no != ODPP_LOCAL) {
+               if (vport->port_no != OVSP_LOCAL) {
                        dp_sysfs_del_if(vport);
                        dp_sysfs_add_if(vport);
                }