diff options
-rw-r--r-- | net/ipv4/route.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 465196e87153..860b3fd2f54b 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -931,14 +931,23 @@ out_put_peer: | |||
931 | 931 | ||
932 | static int ip_error(struct sk_buff *skb) | 932 | static int ip_error(struct sk_buff *skb) |
933 | { | 933 | { |
934 | struct in_device *in_dev = __in_dev_get_rcu(skb->dev); | ||
935 | struct rtable *rt = skb_rtable(skb); | 934 | struct rtable *rt = skb_rtable(skb); |
935 | struct net_device *dev = skb->dev; | ||
936 | struct in_device *in_dev; | ||
936 | struct inet_peer *peer; | 937 | struct inet_peer *peer; |
937 | unsigned long now; | 938 | unsigned long now; |
938 | struct net *net; | 939 | struct net *net; |
939 | bool send; | 940 | bool send; |
940 | int code; | 941 | int code; |
941 | 942 | ||
943 | if (netif_is_l3_master(skb->dev)) { | ||
944 | dev = __dev_get_by_index(dev_net(skb->dev), IPCB(skb)->iif); | ||
945 | if (!dev) | ||
946 | goto out; | ||
947 | } | ||
948 | |||
949 | in_dev = __in_dev_get_rcu(dev); | ||
950 | |||
942 | /* IP on this device is disabled. */ | 951 | /* IP on this device is disabled. */ |
943 | if (!in_dev) | 952 | if (!in_dev) |
944 | goto out; | 953 | goto out; |