mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
223b229b63
commit
ce5c144f48
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue