-static void
-poll_notify(struct list *list)
-{
- struct netdev_linux_notifier *notifier;
- LIST_FOR_EACH (notifier, node, list) {
- struct netdev_notifier *n = ¬ifier->notifier;
- n->cb(n);
- }
-}
-
-static void
-netdev_linux_poll_cb(const struct rtnetlink_link_change *change,
- void *aux OVS_UNUSED)
-{
- if (change) {
- struct list *list = shash_find_data(&netdev_linux_notifiers,
- change->ifname);
- if (list) {
- poll_notify(list);
- }
- } else {
- struct shash_node *node;
- SHASH_FOR_EACH (node, &netdev_linux_notifiers) {
- poll_notify(node->data);
- }
- }
-}
-
-static int
-netdev_linux_poll_add(struct netdev *netdev,
- void (*cb)(struct netdev_notifier *), void *aux,
- struct netdev_notifier **notifierp)
-{
- const char *netdev_name = netdev_get_name(netdev);
- struct netdev_linux_notifier *notifier;
- struct list *list;
-
- if (shash_is_empty(&netdev_linux_notifiers)) {
- int error;
- error = rtnetlink_link_notifier_register(&netdev_linux_poll_notifier,
- netdev_linux_poll_cb, NULL);
- if (error) {
- return error;
- }
- }
-
- list = shash_find_data(&netdev_linux_notifiers, netdev_name);
- if (!list) {
- list = xmalloc(sizeof *list);
- list_init(list);
- shash_add(&netdev_linux_notifiers, netdev_name, list);
- }
-
- notifier = xmalloc(sizeof *notifier);
- netdev_notifier_init(¬ifier->notifier, netdev, cb, aux);
- list_push_back(list, ¬ifier->node);
- *notifierp = ¬ifier->notifier;
- return 0;
-}
-
-static void
-netdev_linux_poll_remove(struct netdev_notifier *notifier_)