diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 459d7e630cb0..124bf8fdf924 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -364,6 +364,11 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk, iph->tos, dev); if (unlikely(err)) goto drop_error; + } else { + struct in_device *in_dev = __in_dev_get_rcu(dev); + + if (in_dev && IN_DEV_ORCONF(in_dev, NOPOLICY)) + IPCB(skb)->flags |= IPSKB_NOPOLICY; } #ifdef CONFIG_IP_ROUTE_CLASSID