Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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 {