Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318912
b: refs/heads/master
c: 9cb429d
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jul 24, 2012
1 parent 36ce32c commit 0d63cd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 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: c20cd5d753a452807b080bbf390e2f844d7991b3
refs/heads/master: 9cb429d692b341e972b12e6cd097364050ebbb26
5 changes: 4 additions & 1 deletion trunk/net/ipv4/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
9 changes: 2 additions & 7 deletions trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,6 @@ void tcp_v4_early_demux(struct sk_buff *skb)
struct net *net = dev_net(skb->dev);
const struct iphdr *iph;
const struct tcphdr *th;
struct net_device *dev;
struct sock *sk;

if (skb->pkt_type != PACKET_HOST)
Expand All @@ -1701,14 +1700,10 @@ void tcp_v4_early_demux(struct sk_buff *skb)
if (th->doff < sizeof(struct tcphdr) / 4)
return;

if (!pskb_may_pull(skb, ip_hdrlen(skb) + th->doff * 4))
return;

dev = skb->dev;
sk = __inet_lookup_established(net, &tcp_hashinfo,
iph->saddr, th->source,
iph->daddr, ntohs(th->dest),
dev->ifindex);
skb->skb_iif);
if (sk) {
skb->sk = sk;
skb->destructor = sock_edemux;
Expand All @@ -1718,7 +1713,7 @@ void tcp_v4_early_demux(struct sk_buff *skb)
if (dst)
dst = dst_check(dst, 0);
if (dst &&
icsk->rx_dst_ifindex == dev->ifindex)
icsk->rx_dst_ifindex == skb->skb_iif)
skb_dst_set_noref(skb, dst);
}
}
Expand Down

0 comments on commit 0d63cd4

Please sign in to comment.