X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev-linux.c;h=1efbfd88a26e2bec680b288c689119367d1b6c70;hb=58f8f0e703234efbd915009d184dba7c3c90059b;hp=ed97eb3c509742675bccf5ba57cb68f85701dd11;hpb=2fe27d5ad27f3c7879ea696209bcf9702d9b7109;p=openvswitch diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index ed97eb3c..1efbfd88 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -598,20 +598,22 @@ static void netdev_linux_destroy(struct netdev_dev *netdev_dev_) { struct netdev_dev_linux *netdev_dev = netdev_dev_linux_cast(netdev_dev_); - const char *type = netdev_dev_get_type(netdev_dev_); + const struct netdev_class *class = netdev_dev_get_class(netdev_dev_); if (netdev_dev->tc && netdev_dev->tc->ops->tc_destroy) { netdev_dev->tc->ops->tc_destroy(netdev_dev->tc); } - if (!strcmp(type, "system")) { + if (class == &netdev_linux_class || class == &netdev_internal_class) { cache_notifier_refcount--; if (!cache_notifier_refcount) { rtnetlink_notifier_unregister(&netdev_linux_cache_notifier); } - } else if (!strcmp(type, "tap")) { + } else if (class == &netdev_tap_class) { destroy_tap(netdev_dev); + } else { + NOT_REACHED(); } free(netdev_dev);