From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: [PATCH v1] net: bonding: Replace mac address parsing Date: Tue, 19 Dec 2017 20:20:44 +0200 Message-ID: <20171219182044.5678-1-andriy.shevchenko@linux.intel.com> Cc: Andy Shevchenko To: Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , netdev@vger.kernel.org Return-path: Received: from mga14.intel.com ([192.55.52.115]:23654 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbdLSSVr (ORCPT ); Tue, 19 Dec 2017 13:21:47 -0500 Sender: netdev-owner@vger.kernel.org List-ID: Replace sscanf() with mac_pton(). Signed-off-by: Andy Shevchenko --- drivers/net/bonding/bond_options.c | 6 +----- 1 file changed, 1 insertion(+), 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 { -- 2.15.1