net/failsafe: use new ethernet address parser
Use rte_ether_unformat_addr rather than sscanf. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
This commit is contained in:
parent
8eb49a1860
commit
1cf34a4e39
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user