aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_input.c')
-rw-r--r--net/ipv4/ip_input.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 93134b0eab0c..f1395a6fb35f 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -314,6 +314,7 @@ drop:
314} 314}
315 315
316int sysctl_ip_early_demux __read_mostly = 1; 316int sysctl_ip_early_demux __read_mostly = 1;
317EXPORT_SYMBOL(sysctl_ip_early_demux);
317 318
318static int ip_rcv_finish(struct sk_buff *skb) 319static int ip_rcv_finish(struct sk_buff *skb)
319{ 320{
@@ -324,14 +325,12 @@ static int ip_rcv_finish(struct sk_buff *skb)
324 const struct net_protocol *ipprot; 325 const struct net_protocol *ipprot;
325 int protocol = iph->protocol; 326 int protocol = iph->protocol;
326 327
327 rcu_read_lock();
328 ipprot = rcu_dereference(inet_protos[protocol]); 328 ipprot = rcu_dereference(inet_protos[protocol]);
329 if (ipprot && ipprot->early_demux) { 329 if (ipprot && ipprot->early_demux) {
330 ipprot->early_demux(skb); 330 ipprot->early_demux(skb);
331 /* must reload iph, skb->head might have changed */ 331 /* must reload iph, skb->head might have changed */
332 iph = ip_hdr(skb); 332 iph = ip_hdr(skb);
333 } 333 }
334 rcu_read_unlock();
335 } 334 }
336 335
337 /* 336 /*
@@ -339,8 +338,8 @@ static int ip_rcv_finish(struct sk_buff *skb)
339 * how the packet travels inside Linux networking. 338 * how the packet travels inside Linux networking.
340 */ 339 */
341 if (!skb_dst(skb)) { 340 if (!skb_dst(skb)) {
342 int err = ip_route_input(skb, iph->daddr, iph->saddr, 341 int err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
343 iph->tos, skb->dev); 342 iph->tos, skb->dev);
344 if (unlikely(err)) { 343 if (unlikely(err)) {
345 if (err == -EXDEV) 344 if (err == -EXDEV)
346 NET_INC_STATS_BH(dev_net(skb->dev), 345 NET_INC_STATS_BH(dev_net(skb->dev),