lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Dec 2017 09:25:46 -0500
From:   Andy Gospodarek <andy@...yhouse.net>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Jay Vosburgh <j.vosburgh@...il.com>,
        Veaceslav Falico <vfalico@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1] net: bonding: Replace mac address parsing

On Tue, Dec 19, 2017 at 08:20:44PM +0200, Andy Shevchenko wrote:
> Replace sscanf() with mac_pton().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Nice cleanup.  Thanks!

Acked-by: Andy Gospodarek <andy@...yhouse.net>

> ---
>  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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ