Commit ce5c144f authored by Andy Shevchenko's avatar Andy Shevchenko Committed by David S. Miller

net: bonding: Replace mac address parsing

Replace sscanf() with mac_pton().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarAndy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 223b229b
...@@ -1431,13 +1431,9 @@ static int bond_option_ad_actor_system_set(struct bonding *bond, ...@@ -1431,13 +1431,9 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
{ {
u8 macaddr[ETH_ALEN]; u8 macaddr[ETH_ALEN];
u8 *mac; u8 *mac;
int i;
if (newval->string) { if (newval->string) {
i = sscanf(newval->string, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", if (!mac_pton(newval->string, macaddr))
&macaddr[0], &macaddr[1], &macaddr[2],
&macaddr[3], &macaddr[4], &macaddr[5]);
if (i != ETH_ALEN)
goto err; goto err;
mac = macaddr; mac = macaddr;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment