aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-08-17 15:01:38 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 20:10:38 -0400
commitdbe5775bbc00116ed5699babfe17c54f32eb34c3 (patch)
treea835930d949396e1803384a549c7cafe59c3c053
parent2d47b45951af087c1a4439c559309b0bf90a0718 (diff)
net: rps: skip fragment when computing rxhash
Fragmented IP packets may have no transfer header, so when computing rxhash, we should skip them. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/dev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index cf87fde3a29b..7e97e891636e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2284,7 +2284,10 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
2284 goto done; 2284 goto done;
2285 2285
2286 ip = (struct iphdr *) skb->data + nhoff; 2286 ip = (struct iphdr *) skb->data + nhoff;
2287 ip_proto = ip->protocol; 2287 if (ip->frag_off & htons(IP_MF | IP_OFFSET))
2288 ip_proto = 0;
2289 else
2290 ip_proto = ip->protocol;
2288 addr1 = (__force u32) ip->saddr; 2291 addr1 = (__force u32) ip->saddr;
2289 addr2 = (__force u32) ip->daddr; 2292 addr2 = (__force u32) ip->daddr;
2290 ihl = ip->ihl; 2293 ihl = ip->ihl;