ipv6 route: Use ipv6_addr_hash() in rt6_info_hash_nhsfn().
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Sun, 13 Jan 2013 05:02:29 +0000 (05:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Jan 2013 01:17:14 +0000 (20:17 -0500)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index 6238eb5037a7d99c0fd23b71cfca8e14a3ef3f6b..34f392f050c15beaad14f7e3116855e88a8a4f45 100644 (file)
@@ -388,15 +388,8 @@ static int rt6_info_hash_nhsfn(unsigned int candidate_count,
 {
        unsigned int val = fl6->flowi6_proto;
 
-       val ^= (__force u32)fl6->daddr.s6_addr32[0];
-       val ^= (__force u32)fl6->daddr.s6_addr32[1];
-       val ^= (__force u32)fl6->daddr.s6_addr32[2];
-       val ^= (__force u32)fl6->daddr.s6_addr32[3];
-
-       val ^= (__force u32)fl6->saddr.s6_addr32[0];
-       val ^= (__force u32)fl6->saddr.s6_addr32[1];
-       val ^= (__force u32)fl6->saddr.s6_addr32[2];
-       val ^= (__force u32)fl6->saddr.s6_addr32[3];
+       val ^= ipv6_addr_hash(&fl6->daddr);
+       val ^= ipv6_addr_hash(&fl6->saddr);
 
        /* Work only if this not encapsulated */
        switch (fl6->flowi6_proto) {