diff options
author | Ethan Jackson <ethan@nicira.com> | 2011-08-23 17:20:00 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2011-09-01 17:21:49 -0700 |
commit | f14d80834e73e5e91892e4763e01ccfd3a2d3be2 (patch) | |
tree | edc9ee891bfce5fb0c923939313d38c7ec26648d /datapath/dp_notify.c | |
parent | e408762f5d16370d9308c22f8f9853d911e92a95 (diff) |
datapath: genl_notify() on port disappearances.
Before this patch, if a vport detached itself from the datapath
without interaction from userspace, rtnetlink notifications would
be sent, but genl notifications would not.
Feature #6809.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/dp_notify.c')
-rw-r--r-- | datapath/dp_notify.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/datapath/dp_notify.c b/datapath/dp_notify.c index 94d671dd..7b3b219a 100644 --- a/datapath/dp_notify.c +++ b/datapath/dp_notify.c @@ -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,8 +34,23 @@ 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: |