X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-linux.c;h=e9beebf1a408f1b11d1d75d83b2274371b2cbfb3;hb=cceb11f5b12d09cc8afc87ca4fd03e941234d439;hp=168cd012f1b7466ac8170ea87b03ce765b71b709;hpb=6f2f5cce6c3fa59fb73f3489ddbcb988131faec7;p=sliver-openvswitch.git diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 168cd012f..e9beebf1a 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -446,7 +446,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)); @@ -2025,6 +2025,26 @@ netdev_linux_get_next_hop(const struct in_addr *host, struct in_addr *next_hop, return ENXIO; } +static int +netdev_linux_get_status(const struct netdev *netdev, struct shash *sh) +{ + struct ethtool_drvinfo drvinfo; + int error; + + memset(&drvinfo, 0, sizeof drvinfo); + error = netdev_linux_do_ethtool(netdev_get_name(netdev), + (struct ethtool_cmd *)&drvinfo, + ETHTOOL_GDRVINFO, + "ETHTOOL_GDRVINFO"); + if (!error) { + shash_add(sh, "driver_name", xstrdup(drvinfo.driver)); + shash_add(sh, "driver_version", xstrdup(drvinfo.version)); + shash_add(sh, "firmware_version", xstrdup(drvinfo.fw_version)); + } + + return error; +} + /* Looks up the ARP table entry for 'ip' on 'netdev'. If one exists and can be * successfully retrieved, it stores the corresponding MAC address in 'mac' and * returns 0. Otherwise, it returns a positive errno value; in particular, @@ -2238,7 +2258,7 @@ netdev_linux_poll_remove(struct netdev_notifier *notifier_) netdev_linux_get_in6, \ netdev_linux_add_router, \ netdev_linux_get_next_hop, \ - NULL, /* get_status */ \ + netdev_linux_get_status, \ netdev_linux_arp_lookup, \ \ netdev_linux_update_flags, \