diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-12-19 20:20:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-20 12:47:29 -0500 |
commit | ce5c144f48d5e465bd9b9d676902cf4dcfcae4b9 (patch) | |
tree | dcdbe5318085b4e93f8ceff58c057327a87e6fad /drivers/net/bonding | |
parent | 223b229b63f461cd3c14583a0e517fde19e7a081 (diff) |
net: bonding: Replace mac address parsing
Replace sscanf() with mac_pton().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_options.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index 8a9b085c2a98..58c705f24f96 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -1431,13 +1431,9 @@ static int bond_option_ad_actor_system_set(struct bonding *bond, { u8 macaddr[ETH_ALEN]; u8 *mac; - int i; if (newval->string) { - i = sscanf(newval->string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &macaddr[0], &macaddr[1], &macaddr[2], - &macaddr[3], &macaddr[4], &macaddr[5]); - if (i != ETH_ALEN) + if (!mac_pton(newval->string, macaddr)) goto err; mac = macaddr; } else { |