--- zzzz-none-000/linux-3.10.107/net/ipv6/addrconf.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/net/ipv6/addrconf.c 2021-11-10 11:53:56.000000000 +0000 @@ -38,6 +38,12 @@ * status etc. */ +/** + * Some part of this file is modified by Ikanos Communications. + * + * Copyright (C) 2013-2014 Ikanos Communications. + */ + #define pr_fmt(fmt) "IPv6: " fmt #include @@ -5323,3 +5329,31 @@ destroy_workqueue(addrconf_wq); } + + +#if defined(CONFIG_MACH_FUSIV) +/* + * Get net device if v6 address is configured on any interface + */ +struct net_device *ipv6_dev_find(struct net *net, struct in6_addr *addr) +{ + struct net_device *dev = NULL; + struct inet6_ifaddr * ifp; + struct hlist_node *node; + u32 hash = inet6_addr_hash(addr); + rcu_read_lock_bh(); + hlist_for_each_entry_rcu(ifp, &inet6_addr_lst[hash], addr_lst) { //Modified for 3.10.28 + if (!net_eq(dev_net(ifp->idev->dev), net)) + continue; + if (ipv6_addr_equal(&ifp->addr, addr)) { + dev = ifp->idev->dev; + break; + } + + } + rcu_read_unlock_bh(); + return dev; +} +EXPORT_SYMBOL(ipv6_dev_find); +#endif +