ovs-brcompatd: Delete ports when netdevs on fake bridges disappear.
[openvswitch] / vswitchd / ovs-brcompatd.c
index 3dd25c37b2e2cf569ea9c13375656a7b58b90812..bfa13ca26b7476c56ea8e3fa49c3bed641d58837 100644 (file)
 #include "leak-checker.h"
 #include "netdev.h"
 #include "netlink.h"
+#include "netlink-notifier.h"
 #include "netlink-socket.h"
 #include "ofpbuf.h"
 #include "openvswitch/brcompat-netlink.h"
 #include "packets.h"
 #include "poll-loop.h"
 #include "process.h"
-#include "rtnetlink.h"
 #include "rtnetlink-link.h"
 #include "signals.h"
 #include "sset.h"
@@ -488,7 +488,7 @@ handle_fdb_query_cmd(struct ofpbuf *buffer)
         struct mac *mac = &local_macs[n_local_macs];
         struct netdev *netdev;
 
-        error = netdev_open_default(iface_name, &netdev);
+        error = netdev_open(iface_name, "system", &netdev);
         if (!error) {
             if (!netdev_get_etheraddr(netdev, mac->addr)) {
                 n_local_macs++;
@@ -790,7 +790,7 @@ netdev_changed_cb(const struct rtnetlink_link_change *change,
               port_name, br_name);
 
     run_vsctl(vsctl_program, VSCTL_OPTIONS,
-              "--", "--if-exists", "del-port", br_name, port_name,
+              "--", "--if-exists", "del-port", port_name,
               "--", "comment", "ovs-brcompatd:", port_name, "disappeared",
               (char *) NULL);
 }
@@ -799,7 +799,7 @@ int
 main(int argc, char *argv[])
 {
     extern struct vlog_module VLM_reconnect;
-    struct rtnetlink_notifier link_notifier;
+    struct nln_notifier link_notifier;
     struct unixctl_server *unixctl;
     int retval;
 
@@ -880,12 +880,11 @@ parse_options(int argc, char *argv[])
         }
 
         switch (c) {
-        case 'H':
         case 'h':
             usage();
 
         case 'V':
-            OVS_PRINT_VERSION(0, 0);
+            ovs_print_version(0, 0);
             exit(EXIT_SUCCESS);
 
         case OPT_APPCTL: