aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-08-17 15:04:32 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 20:16:23 -0400
commit12fcdefb3643607c47f39906a49056cf608bb545 (patch)
tree1f0495dcc9b7f4abee57f4ff2107d88ba64c8e97 /net
parente760702ed8333588f9f21e7bf6597873993006f1 (diff)
net: rps: use proto_ports_offset() to handle the AH message correctly
The SPI isn't at the beginning of an AH message. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 7e97e891636..da584f5ab3d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2266,7 +2266,7 @@ static inline void ____napi_schedule(struct softnet_data *sd,
2266 */ 2266 */
2267__u32 __skb_get_rxhash(struct sk_buff *skb) 2267__u32 __skb_get_rxhash(struct sk_buff *skb)
2268{ 2268{
2269 int nhoff, hash = 0; 2269 int nhoff, hash = 0, poff;
2270 struct ipv6hdr *ip6; 2270 struct ipv6hdr *ip6;
2271 struct iphdr *ip; 2271 struct iphdr *ip;
2272 u8 ip_proto; 2272 u8 ip_proto;
@@ -2306,24 +2306,15 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
2306 goto done; 2306 goto done;
2307 } 2307 }
2308 2308
2309 switch (ip_proto) { 2309 ports.v32 = 0;
2310 case IPPROTO_TCP: 2310 poff = proto_ports_offset(ip_proto);
2311 case IPPROTO_UDP: 2311 if (poff >= 0) {
2312 case IPPROTO_DCCP: 2312 nhoff += ihl * 4 + poff;
2313 case IPPROTO_ESP: 2313 if (pskb_may_pull(skb, nhoff + 4)) {
2314 case IPPROTO_AH: 2314 ports.v32 = * (__force u32 *) (skb->data + nhoff);
2315 case IPPROTO_SCTP:
2316 case IPPROTO_UDPLITE:
2317 if (pskb_may_pull(skb, (ihl * 4) + 4 + nhoff)) {
2318 ports.v32 = * (__force u32 *) (skb->data + nhoff +
2319 (ihl * 4));
2320 if (ports.v16[1] < ports.v16[0]) 2315 if (ports.v16[1] < ports.v16[0])
2321 swap(ports.v16[0], ports.v16[1]); 2316 swap(ports.v16[0], ports.v16[1]);
2322 break;
2323 } 2317 }
2324 default:
2325 ports.v32 = 0;
2326 break;
2327 } 2318 }
2328 2319
2329 /* get a consistent hash (same value on both flow directions) */ 2320 /* get a consistent hash (same value on both flow directions) */