aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_input.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-07-24 01:19:31 +0000
committerDavid S. Miller <davem@davemloft.net>2012-07-24 13:54:15 -0700
commit9cb429d692b341e972b12e6cd097364050ebbb26 (patch)
tree39450b1d5650322fc6cffca581f34edbc06233ee /net/ipv4/ip_input.c
parentbnx2x: Correct EEE statistics gathering (diff)
downloadlinux-dev-9cb429d692b341e972b12e6cd097364050ebbb26.tar.xz
linux-dev-9cb429d692b341e972b12e6cd097364050ebbb26.zip
tcp: early_demux fixes
1) Remove a non needed pskb_may_pull() in tcp_v4_early_demux() and fix a potential bug if skb->head was reallocated (iph & th pointers were not reloaded) TCP stack will pull/check headers anyway. 2) must reload iph in ip_rcv_finish() after early_demux() call since skb->head might have changed. 3) skb->dev->ifindex can be now replaced by skb->skb_iif Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_input.c')
-rw-r--r--net/ipv4/ip_input.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 4ebc6feee250..93134b0eab0c 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -326,8 +326,11 @@ static int ip_rcv_finish(struct sk_buff *skb)
rcu_read_lock();
ipprot = rcu_dereference(inet_protos[protocol]);
- if (ipprot && ipprot->early_demux)
+ if (ipprot && ipprot->early_demux) {
ipprot->early_demux(skb);
+ /* must reload iph, skb->head might have changed */
+ iph = ip_hdr(skb);
+ }
rcu_read_unlock();
}