X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev-linux.c;h=9deea57da6408e1f9734d8cbdaf7e8d94fb53849;hb=f696f12fbe84f49d650f48c45ce1a24b94547ad2;hp=72541c7978c08cce05654d7902da687c2df8c862;hpb=e210037edde788ffcc03497019903dadd6eadcfa;p=openvswitch diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 72541c79..9deea57d 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -47,6 +47,7 @@ #include #include "coverage.h" +#include "dpif-linux.h" #include "dynamic-string.h" #include "fatal-signal.h" #include "hash.h" @@ -446,7 +447,7 @@ netdev_linux_init(void) /* Create rtnetlink socket. */ if (!status) { - status = nl_sock_create(NETLINK_ROUTE, 0, 0, 0, &rtnl_sock); + status = nl_sock_create(NETLINK_ROUTE, &rtnl_sock); if (status) { VLOG_ERR_RL(&rl, "failed to create rtnetlink socket: %s", strerror(status)); @@ -522,7 +523,7 @@ netdev_linux_create(const struct netdev_class *class, cache_notifier_refcount++; netdev_dev = xzalloc(sizeof *netdev_dev); - netdev_dev_init(&netdev_dev->netdev_dev, name, class); + netdev_dev_init(&netdev_dev->netdev_dev, name, args, class); *netdev_devp = &netdev_dev->netdev_dev; return 0; @@ -576,7 +577,7 @@ netdev_linux_create_tap(const struct netdev_class *class OVS_UNUSED, goto error; } - netdev_dev_init(&netdev_dev->netdev_dev, name, &netdev_tap_class); + netdev_dev_init(&netdev_dev->netdev_dev, name, args, &netdev_tap_class); *netdev_devp = &netdev_dev->netdev_dev; return 0; @@ -1105,22 +1106,8 @@ netdev_linux_update_is_pseudo(struct netdev_dev_linux *netdev_dev) const char *type = netdev_dev_get_type(&netdev_dev->netdev_dev); netdev_dev->is_tap = !strcmp(type, "tap"); - netdev_dev->is_internal = false; - if (!netdev_dev->is_tap) { - struct ethtool_drvinfo drvinfo; - int error; - - memset(&drvinfo, 0, sizeof drvinfo); - error = netdev_linux_do_ethtool(name, - (struct ethtool_cmd *)&drvinfo, - ETHTOOL_GDRVINFO, - "ETHTOOL_GDRVINFO"); - - if (!error && !strcmp(drvinfo.driver, "openvswitch")) { - netdev_dev->is_internal = true; - } - } - + netdev_dev->is_internal = (!netdev_dev->is_tap + && dpif_linux_is_internal_device(name)); netdev_dev->cache_valid |= VALID_IS_PSEUDO; } } @@ -2214,7 +2201,7 @@ netdev_linux_poll_remove(struct netdev_notifier *notifier_) \ CREATE, \ netdev_linux_destroy, \ - NULL, /* reconfigure */ \ + NULL, /* set_config */ \ \ netdev_linux_open, \ netdev_linux_close, \