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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 15 Aug 2011 17:00:16 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	nirmu@....mellanox.co.il
Cc:	netdev@...r.kernel.org, Nir Muchtar <nirmu@...lanox.com>
Subject: Re: [PATCH] ethtool: RX NFC - Convert ip address to big endian.

On Mon, 2011-08-15 at 18:40 +0300, nirmu@....mellanox.co.il wrote:
> From: Nir Muchtar <nirmu@....mellanox.co.il>
> 
> Signed-off-by: Nir Muchtar <nirmu@...lanox.com>
> ---
> Unless there's a reason that I'm missing to why the user
> is expected to specify ip addresses in big endian format.
> 
>  rxclass.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/rxclass.c b/rxclass.c
> index b227901..98d035b 100644
> --- a/rxclass.c
> +++ b/rxclass.c
> @@ -704,7 +704,7 @@ static int rxclass_get_ulong(char *str, unsigned long long *val, int size)
>  	return 0;
>  }
>  
> -static int rxclass_get_ipv4(char *str, __be32 *val)
> +static int rxclass_get_ipv4(char *str, u32 *val)
>  {
>  	if (!inet_pton(AF_INET, str, val))
>  		return -1;
[...]

inet_pton() does the conversion to big-endian format.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ