aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-02-07 10:48:42 -0800
committerDavid S. Miller <davem@davemloft.net>2019-02-07 10:48:42 -0800
commitec7fd009e87cf5459fe9aef1c9a6111e093e49cd (patch)
tree79016b006cd80fb1139261887c3f80eda1849f9c /net
parentnet: Don't default Cavium PTP driver to 'y' (diff)
parentsit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach() (diff)
downloadwireguard-linux-ec7fd009e87cf5459fe9aef1c9a6111e093e49cd.tar.xz
wireguard-linux-ec7fd009e87cf5459fe9aef1c9a6111e093e49cd.zip
Merge branch 'ipv6-fixes'
Hangbin Liu says: ==================== fix two kernel panics when disabled IPv6 on boot up When disabled IPv6 on boot up, since there is no ipv6 route tables, we should not call rt6_lookup. Fix them by checking if we have inet6_dev pointer on netdevice. v2: Fix idev reference leak, declarations and code mixing as Stefano, Eric pointed. Since we only want to check if idev exists and not reference it, use __in6_dev_get() insteand of in6_dev_get(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/sit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 1e03305c0549..e8a1dabef803 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -546,7 +546,8 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
}
err = 0;
- if (!ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len))
+ if (__in6_dev_get(skb->dev) &&
+ !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len))
goto out;
if (t->parms.iph.daddr == 0)