--- zzzz-none-000/linux-4.4.60/net/ipv6/addrconf.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/net/ipv6/addrconf.c 2021-02-04 17:41:59.000000000 +0000 @@ -1768,6 +1768,35 @@ return result; } +/* ipv6_dev_find() + * Find (and hold) net device that has the given address. + * Or NULL on failure. + */ +struct net_device *ipv6_dev_find(struct net *net, struct in6_addr *addr, + int strict) +{ + struct inet6_ifaddr *ifp; + struct net_device *dev; + + ifp = ipv6_get_ifaddr(net, addr, NULL, strict); + if (!ifp) + return NULL; + + if (!ifp->idev) { + in6_ifa_put(ifp); + return NULL; + } + + dev = ifp->idev->dev; + if (dev) + dev_hold(dev); + + in6_ifa_put(ifp); + + return dev; +} +EXPORT_SYMBOL(ipv6_dev_find); + /* Gets referenced address, destroys ifaddr */ static void addrconf_dad_stop(struct inet6_ifaddr *ifp, int dad_failed) @@ -2053,6 +2082,7 @@ case ARPHRD_IEEE1394: return addrconf_ifid_ieee1394(eui, dev); case ARPHRD_TUNNEL6: + case ARPHRD_RAWIP: return addrconf_ifid_ip6tnl(eui, dev); } return -1; @@ -3076,7 +3106,8 @@ (dev->type != ARPHRD_IEEE802154) && (dev->type != ARPHRD_IEEE1394) && (dev->type != ARPHRD_TUNNEL6) && - (dev->type != ARPHRD_6LOWPAN)) { + (dev->type != ARPHRD_6LOWPAN) && + (dev->type != ARPHRD_RAWIP)) { /* Alas, we support only Ethernet autoconfiguration. */ return; }