X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev.c;h=38f4dd58561ad5a2abd9e78d8c22294eccbc4ad1;hb=79903dd171cd7bdbb52710b98dbaa5de1537de87;hp=dc27fd749e2324a0786b6b20128ba9bfda7cc65d;hpb=c1c9c9c4b636ab2acf2f75024c282a9a497ca9a9;p=openvswitch diff --git a/lib/netdev.c b/lib/netdev.c index dc27fd74..38f4dd58 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -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