From: Stephen Hemminger Date: Fri, 5 Jul 2019 17:16:25 +0000 (-0700) Subject: net/vdev_netvsc: use new ethernet address parser X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=72505bf36fad5133d09c4685d630625ee343db09;p=dpdk.git net/vdev_netvsc: use new ethernet address parser Use rte_ether_unformat_addr rather than sscanf. Signed-off-by: Stephen Hemminger Acked-by: Matan Azrad --- diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 1fcf90d7bc..be8f19c0c6 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -529,15 +529,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) { struct rte_ether_addr tmp; - if (sscanf(pair->value, - "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":" - "%" SCNx8 ":%" SCNx8 ":%" SCNx8, - &tmp.addr_bytes[0], - &tmp.addr_bytes[1], - &tmp.addr_bytes[2], - &tmp.addr_bytes[3], - &tmp.addr_bytes[4], - &tmp.addr_bytes[5]) != 6) { + if (rte_ether_unformat_addr(pair->value, &tmp) != 0) { DRV_LOG(ERR, "invalid MAC address format" " \"%s\"",