From 72505bf36fad5133d09c4685d630625ee343db09 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 5 Jul 2019 10:16:25 -0700 Subject: [PATCH] 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 --- drivers/net/vdev_netvsc/vdev_netvsc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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\"", -- 2.20.1