IPv6: use ipv6_addr_v4mapped()
Subsystems (3)
PATCH 1/1 IPv6: use ipv6_addr_v4mapped()
Change udp6_portaddr_hash() to use ipv6_addr_v4mapped() inline instead of ipv6_addr_type().
Signed-off-by Brian Haley <[email protected]>
---
net/ipv6/udp.c +1 -1
@@ -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);
Quoted 11 lines · Brian Haley
Change
udp6_portaddr_hash()to useipv6_addr_v4mapped()inline instead ofipv6_addr_type().Signed-off-by Brian Haley <[email protected]>---
net/ipv6/udp.c +0
-0
net/ipv6/udp.c static unsigned int udp6_portaddr_hash(struct net *net, · line 95
Quoted 8 lines
net/ipv6/udp.c +1
-1@@ -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 <[email protected]>
Thanks Brian
From: Brian Haley <[email protected]>
Date: Mon, 09 Nov 2009 17:05:53 -0500
Quoted 4 lines
Change
udp6_portaddr_hash()to useipv6_addr_v4mapped()inline instead ofipv6_addr_type().Signed-off-by Brian Haley <[email protected]>
Applied to net-next-2.6