[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1426360760.4173.101.camel@decadent.org.uk>
Date: Sat, 14 Mar 2015 19:19:20 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Stephen Hemminger <shemming@...cade.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH iproute2] ss: better 32bit support
On Tue, 2015-03-10 at 09:56 -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Socket cookies are 64bit, even if ss happens to be
> a 32bit binary, running on a 64 bit host.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
> misc/ss.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/misc/ss.c b/misc/ss.c
> index 21a4366..ba58894 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -679,9 +679,9 @@ static inline char *sock_addr_get_str(const inet_prefix *prefix)
> return tmp;
> }
>
> -static unsigned long cookie_sk_get(uint32_t *cookie)
> +static unsigned long long cookie_sk_get(const uint32_t *cookie)
> {
> - return (((unsigned long)cookie[1] << 31) << 1) | cookie[0];
> + return (((unsigned long long)cookie[1] << 31) << 1) | cookie[0];
Then you should also use << 32 instead of splitting it into two shifts.
Ben.
> }
>
> static const char *sstate_name[] = {
--
Ben Hutchings
Q. Which is the greater problem in the world today, ignorance or apathy?
A. I don't know and I couldn't care less.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists