netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Brian Haley <brian.haley@hp.com>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] IPv6: use ipv6_addr_v4mapped()
Date: Mon, 09 Nov 2009 23:59:53 +0100	[thread overview]
Message-ID: <4AF89EE9.1090109@gmail.com> (raw)
In-Reply-To: <4AF89241.7060203@hp.com>

Brian Haley a écrit :
> Change udp6_portaddr_hash() to use ipv6_addr_v4mapped()
> inline instead of ipv6_addr_type().
> 
> Signed-off-by: Brian Haley <brian.haley@hp.com>
> ---
> 
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 2915e1d..0ed1637 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -89,7 +89,7 @@ static unsigned int udp6_portaddr_hash(struct net *net,
>  
>  	if (ipv6_addr_any(addr6))
>  		hash = jhash_1word(0, mix);
> -	else if (ipv6_addr_type(addr6) == IPV6_ADDR_MAPPED)
> +	else if (ipv6_addr_v4mapped(addr6))
>  		hash = jhash_1word(addr6->s6_addr32[3], mix);
>  	else
>  		hash = jhash2(addr6->s6_addr32, 4, mix);

Indeed, its a bit faster ;)

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Thanks Brian


  reply	other threads:[~2009-11-09 22:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09 22:05 [PATCH] IPv6: use ipv6_addr_v4mapped() Brian Haley
2009-11-09 22:59 ` Eric Dumazet [this message]
2009-11-11  6:34 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF89EE9.1090109@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).