shash: New function shash_replace().
[openvswitch] / lib / netdev.c
index dc27fd749e2324a0786b6b20128ba9bfda7cc65d..38f4dd58561ad5a2abd9e78d8c22294eccbc4ad1 100644 (file)
@@ -1483,9 +1483,7 @@ netdev_monitor_cb(struct netdev_notifier *notifier)
 {
     struct netdev_monitor *monitor = notifier->aux;
     const char *name = netdev_get_name(notifier->netdev);
-    if (!shash_find(&monitor->changed_netdevs, name)) {
-        shash_add(&monitor->changed_netdevs, name, NULL);
-    }
+    shash_add_once(&monitor->changed_netdevs, name, NULL);
 }
 
 /* Attempts to add 'netdev' as a netdev monitored by 'monitor'.  Returns 0 if