netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IPv6: use ipv6_addr_v4mapped()
@ 2009-11-09 22:05 Brian Haley
  2009-11-09 22:59 ` Eric Dumazet
  2009-11-11  6:34 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Haley @ 2009-11-09 22:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IPv6: use ipv6_addr_v4mapped()
  2009-11-09 22:05 [PATCH] IPv6: use ipv6_addr_v4mapped() Brian Haley
@ 2009-11-09 22:59 ` Eric Dumazet
  2009-11-11  6:34 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2009-11-09 22:59 UTC (permalink / raw)
  To: Brian Haley; +Cc: David Miller, netdev@vger.kernel.org

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IPv6: use ipv6_addr_v4mapped()
  2009-11-09 22:05 [PATCH] IPv6: use ipv6_addr_v4mapped() Brian Haley
  2009-11-09 22:59 ` Eric Dumazet
@ 2009-11-11  6:34 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2009-11-11  6:34 UTC (permalink / raw)
  To: brian.haley; +Cc: netdev

From: Brian Haley <brian.haley@hp.com>
Date: Mon, 09 Nov 2009 17:05:53 -0500

> Change udp6_portaddr_hash() to use ipv6_addr_v4mapped()
> inline instead of ipv6_addr_type().
> 
> Signed-off-by: Brian Haley <brian.haley@hp.com>

Applied to net-next-2.6

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-11  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09 22:05 [PATCH] IPv6: use ipv6_addr_v4mapped() Brian Haley
2009-11-09 22:59 ` Eric Dumazet
2009-11-11  6:34 ` David Miller

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