From: Stephen Hemminger Date: Fri, 5 Jul 2019 17:16:24 +0000 (-0700) Subject: net/failsafe: use new ethernet address parser X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1cf34a4e3904dea0ea1f834420f3dd9c5373033f;p=dpdk.git net/failsafe: use new ethernet address parser Use rte_ether_unformat_addr rather than sscanf. Signed-off-by: Stephen Hemminger Acked-by: Gaetan Rivet --- diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index d2e725bcea..707490b94c 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -368,15 +368,11 @@ fs_get_mac_addr_arg(const char *key __rte_unused, const char *value, void *out) { struct rte_ether_addr *ea = out; - int ret; if ((value == NULL) || (out == NULL)) return -EINVAL; - ret = sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &ea->addr_bytes[0], &ea->addr_bytes[1], - &ea->addr_bytes[2], &ea->addr_bytes[3], - &ea->addr_bytes[4], &ea->addr_bytes[5]); - return ret != RTE_ETHER_ADDR_LEN; + + return rte_ether_unformat_addr(value, ea); } int