diff options
author | Eric Dumazet <edumazet@google.com> | 2012-07-29 17:06:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-30 17:53:21 -0400 |
commit | cca32e4bf999a34ac08d959f351f2b30bcd02460 (patch) | |
tree | 7456e3d00b57ab353bb726219cec83b8b4d101ab /net/ipv4 | |
parent | 8bbb181308bc348e02bfdbebdedd4e4ec9d452ce (diff) |
net: TCP early demux cleanup
early_demux() handlers should be called in RCU context, and as we
use skb_dst_set_noref(skb, dst), caller must not exit from RCU context
before dst use (skb_dst(skb)) or release (skb_drop(dst))
Therefore, rcu_read_lock()/rcu_read_unlock() pairs around
->early_demux() are confusing and not needed :
Protocol handlers are already in an RCU read lock section.
(__netif_receive_skb() does the rcu_read_lock() )
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_input.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 981ff1eef28c..f1395a6fb35f 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -325,14 +325,12 @@ static int ip_rcv_finish(struct sk_buff *skb) | |||
325 | const struct net_protocol *ipprot; | 325 | const struct net_protocol *ipprot; |
326 | int protocol = iph->protocol; | 326 | int protocol = iph->protocol; |
327 | 327 | ||
328 | rcu_read_lock(); | ||
329 | ipprot = rcu_dereference(inet_protos[protocol]); | 328 | ipprot = rcu_dereference(inet_protos[protocol]); |
330 | if (ipprot && ipprot->early_demux) { | 329 | if (ipprot && ipprot->early_demux) { |
331 | ipprot->early_demux(skb); | 330 | ipprot->early_demux(skb); |
332 | /* must reload iph, skb->head might have changed */ | 331 | /* must reload iph, skb->head might have changed */ |
333 | iph = ip_hdr(skb); | 332 | iph = ip_hdr(skb); |
334 | } | 333 | } |
335 | rcu_read_unlock(); | ||
336 | } | 334 | } |
337 | 335 | ||
338 | /* | 336 | /* |