X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fethtool%2Flib%2Frte_ethtool.c;h=571c4e5aa52cdbb5f67303ee52d865d1e2c19144;hb=f319d9937977479528870c6859bd3a227c212f75;hp=e6a2e88c704a1c429156dfe14d629f0205729913;hpb=99d8ebcf5c1ddde1cb9db77a762859a7dbf21268;p=dpdk.git diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index e6a2e88c70..571c4e5aa5 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -43,10 +44,9 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); - snprintf(drvinfo->driver, sizeof(drvinfo->driver), "%s", - dev_info.driver_name); - snprintf(drvinfo->version, sizeof(drvinfo->version), "%s", - rte_version()); + strlcpy(drvinfo->driver, dev_info.driver_name, + sizeof(drvinfo->driver)); + strlcpy(drvinfo->version, rte_version(), sizeof(drvinfo->version)); /* TODO: replace bus_info by rte_devargs.name */ if (dev_info.device) bus = rte_bus_find_by_device(dev_info.device); @@ -303,7 +303,7 @@ rte_ethtool_net_stop(uint16_t port_id) } int -rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr) +rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (addr == NULL) @@ -314,7 +314,7 @@ rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr) } int -rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr) +rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr) { if (addr == NULL) return -EINVAL; @@ -323,11 +323,11 @@ rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr) int rte_ethtool_net_validate_addr(uint16_t port_id __rte_unused, - struct ether_addr *addr) + struct rte_ether_addr *addr) { if (addr == NULL) return -EINVAL; - return is_valid_assigned_ether_addr(addr); + return rte_is_valid_assigned_ether_addr(addr); } int