Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213885
b: refs/heads/master
c: 12fcdef
h: refs/heads/master
i:
  213883: dce27a5
v: v3
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 20, 2010
1 parent 8b0e6fb commit 21bf831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e760702ed8333588f9f21e7bf6597873993006f1
refs/heads/master: 12fcdefb3643607c47f39906a49056cf608bb545
23 changes: 7 additions & 16 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ static inline void ____napi_schedule(struct softnet_data *sd,
*/
__u32 __skb_get_rxhash(struct sk_buff *skb)
{
int nhoff, hash = 0;
int nhoff, hash = 0, poff;
struct ipv6hdr *ip6;
struct iphdr *ip;
u8 ip_proto;
Expand Down Expand Up @@ -2306,24 +2306,15 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
goto done;
}

switch (ip_proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
case IPPROTO_DCCP:
case IPPROTO_ESP:
case IPPROTO_AH:
case IPPROTO_SCTP:
case IPPROTO_UDPLITE:
if (pskb_may_pull(skb, (ihl * 4) + 4 + nhoff)) {
ports.v32 = * (__force u32 *) (skb->data + nhoff +
(ihl * 4));
ports.v32 = 0;
poff = proto_ports_offset(ip_proto);
if (poff >= 0) {
nhoff += ihl * 4 + poff;
if (pskb_may_pull(skb, nhoff + 4)) {
ports.v32 = * (__force u32 *) (skb->data + nhoff);
if (ports.v16[1] < ports.v16[0])
swap(ports.v16[0], ports.v16[1]);
break;
}
default:
ports.v32 = 0;
break;
}

/* get a consistent hash (same value on both flow directions) */
Expand Down

0 comments on commit 21bf831

Please sign in to comment.