Skip to content

Commit

Permalink
net: rps: skip fragment when computing rxhash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 20, 2010
1 parent 2d47b45 commit dbe5775
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,10 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
goto done;

ip = (struct iphdr *) skb->data + nhoff;
ip_proto = ip->protocol;
if (ip->frag_off & htons(IP_MF | IP_OFFSET))
ip_proto = 0;
else
ip_proto = ip->protocol;
addr1 = (__force u32) ip->saddr;
addr2 = (__force u32) ip->daddr;
ihl = ip->ihl;
Expand Down

0 comments on commit dbe5775

Please sign in to comment.