net: rps: fix the wrong network header pointer
authorChangli Gao <xiaosuo@gmail.com>
Sat, 21 Aug 2010 06:13:28 +0000 (06:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Aug 2010 05:54:49 +0000 (22:54 -0700)
__skb_get_rxhash() was broken after the commit:

 commit bfb564e7391340638afe4ad67744a8f3858e7566
 Author: Krishna Kumar <krkumar2@in.ibm.com>
 Date:   Wed Aug 4 06:15:52 2010 +0000

 core: Factor out flow calculation from get_rps_cpu

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index da584f5ab3d2e96784042d4f9e4f03d361d98eba..4d74d26b8e1a1876ee838554118d9759b6b1c58b 100644 (file)
@@ -2283,7 +2283,7 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
                if (!pskb_may_pull(skb, sizeof(*ip) + nhoff))
                        goto done;
 
-               ip = (struct iphdr *) skb->data + nhoff;
+               ip = (struct iphdr *) (skb->data + nhoff);
                if (ip->frag_off & htons(IP_MF | IP_OFFSET))
                        ip_proto = 0;
                else
@@ -2296,7 +2296,7 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
                if (!pskb_may_pull(skb, sizeof(*ip6) + nhoff))
                        goto done;
 
-               ip6 = (struct ipv6hdr *) skb->data + nhoff;
+               ip6 = (struct ipv6hdr *) (skb->data + nhoff);
                ip_proto = ip6->nexthdr;
                addr1 = (__force u32) ip6->saddr.s6_addr32[3];
                addr2 = (__force u32) ip6->daddr.s6_addr32[3];