Commit b3ce5ae1 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

ipv6: fix sparse warnings in rt6_info_hash_nhsfn()

Adding by commit 51ebd318 which adds the support of ECMP for IPv6.
Spotted-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be716446
......@@ -397,32 +397,32 @@ static int rt6_info_hash_nhsfn(unsigned int candidate_count,
{
unsigned int val = fl6->flowi6_proto;
val ^= fl6->daddr.s6_addr32[0];
val ^= fl6->daddr.s6_addr32[1];
val ^= fl6->daddr.s6_addr32[2];
val ^= fl6->daddr.s6_addr32[3];
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 ^= fl6->saddr.s6_addr32[0];
val ^= fl6->saddr.s6_addr32[1];
val ^= fl6->saddr.s6_addr32[2];
val ^= fl6->saddr.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];
/* Work only if this not encapsulated */
switch (fl6->flowi6_proto) {
case IPPROTO_UDP:
case IPPROTO_TCP:
case IPPROTO_SCTP:
val ^= fl6->fl6_sport;
val ^= fl6->fl6_dport;
val ^= (__force u16)fl6->fl6_sport;
val ^= (__force u16)fl6->fl6_dport;
break;
case IPPROTO_ICMPV6:
val ^= fl6->fl6_icmp_type;
val ^= fl6->fl6_icmp_code;
val ^= (__force u16)fl6->fl6_icmp_type;
val ^= (__force u16)fl6->fl6_icmp_code;
break;
}
/* RFC6438 recommands to use flowlabel */
val ^= fl6->flowlabel;
val ^= (__force u32)fl6->flowlabel;
/* Perhaps, we need to tune, this function? */
val = val ^ (val >> 7) ^ (val >> 12);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment