Lines Matching refs:idev

126 static int addrconf_sysctl_register(struct inet6_dev *idev);
127 static void addrconf_sysctl_unregister(struct inet6_dev *idev);
129 static inline int addrconf_sysctl_register(struct inet6_dev *idev) in addrconf_sysctl_register() argument
134 static inline void addrconf_sysctl_unregister(struct inet6_dev *idev) in addrconf_sysctl_unregister() argument
142 static int ipv6_count_addresses(const struct inet6_dev *idev);
145 const struct inet6_dev *idev);
172 static void addrconf_dad_run(struct inet6_dev *idev, bool restart);
177 static void inet6_prefix_notify(int event, struct inet6_dev *idev,
306 static void addrconf_del_rs_timer(struct inet6_dev *idev) in addrconf_del_rs_timer() argument
308 if (del_timer(&idev->rs_timer)) in addrconf_del_rs_timer()
309 __in6_dev_put(idev); in addrconf_del_rs_timer()
318 static void addrconf_mod_rs_timer(struct inet6_dev *idev, in addrconf_mod_rs_timer() argument
321 if (!timer_pending(&idev->rs_timer)) in addrconf_mod_rs_timer()
322 in6_dev_hold(idev); in addrconf_mod_rs_timer()
323 mod_timer(&idev->rs_timer, jiffies + when); in addrconf_mod_rs_timer()
334 static int snmp6_alloc_dev(struct inet6_dev *idev) in snmp6_alloc_dev() argument
338 idev->stats.ipv6 = alloc_percpu_gfp(struct ipstats_mib, GFP_KERNEL_ACCOUNT); in snmp6_alloc_dev()
339 if (!idev->stats.ipv6) in snmp6_alloc_dev()
344 addrconf_stats = per_cpu_ptr(idev->stats.ipv6, i); in snmp6_alloc_dev()
349 idev->stats.icmpv6dev = kzalloc(sizeof(struct icmpv6_mib_device), in snmp6_alloc_dev()
351 if (!idev->stats.icmpv6dev) in snmp6_alloc_dev()
353 idev->stats.icmpv6msgdev = kzalloc(sizeof(struct icmpv6msg_mib_device), in snmp6_alloc_dev()
355 if (!idev->stats.icmpv6msgdev) in snmp6_alloc_dev()
361 kfree(idev->stats.icmpv6dev); in snmp6_alloc_dev()
363 free_percpu(idev->stats.ipv6); in snmp6_alloc_dev()
482 struct inet6_dev *idev; in ipv6_find_idev() local
486 idev = __in6_dev_get(dev); in ipv6_find_idev()
487 if (!idev) { in ipv6_find_idev()
488 idev = ipv6_add_dev(dev); in ipv6_find_idev()
489 if (IS_ERR(idev)) in ipv6_find_idev()
490 return idev; in ipv6_find_idev()
494 ipv6_mc_up(idev); in ipv6_find_idev()
495 return idev; in ipv6_find_idev()
716 struct inet6_dev *idev; in inet6_netconf_dump_devconf() local
746 idev = __in6_dev_get(dev); in inet6_netconf_dump_devconf()
747 if (!idev) in inet6_netconf_dump_devconf()
751 &idev->cnf, in inet6_netconf_dump_devconf()
796 static void dev_forward_change(struct inet6_dev *idev) in dev_forward_change() argument
802 if (!idev) in dev_forward_change()
804 dev = idev->dev; in dev_forward_change()
805 if (idev->cnf.forwarding) in dev_forward_change()
808 if (idev->cnf.forwarding) { in dev_forward_change()
819 read_lock_bh(&idev->lock); in dev_forward_change()
820 list_for_each_entry(ifa, &idev->addr_list, if_list) { in dev_forward_change()
825 read_unlock_bh(&idev->lock); in dev_forward_change()
831 if (idev->cnf.forwarding) in dev_forward_change()
839 dev->ifindex, &idev->cnf); in dev_forward_change()
846 struct inet6_dev *idev; in addrconf_forward_change() local
849 idev = __in6_dev_get(dev); in addrconf_forward_change()
850 if (idev) { in addrconf_forward_change()
851 int changed = (!idev->cnf.forwarding) ^ (!newf); in addrconf_forward_change()
852 idev->cnf.forwarding = newf; in addrconf_forward_change()
854 dev_forward_change(idev); in addrconf_forward_change()
909 struct inet6_dev *idev; in addrconf_linkdown_change() local
912 idev = __in6_dev_get(dev); in addrconf_linkdown_change()
913 if (idev) { in addrconf_linkdown_change()
914 int changed = (!idev->cnf.ignore_routes_with_linkdown) ^ (!newf); in addrconf_linkdown_change()
916 idev->cnf.ignore_routes_with_linkdown = newf; in addrconf_linkdown_change()
922 &idev->cnf); in addrconf_linkdown_change()
976 in6_dev_put(ifp->idev); in inet6_ifa_finish_destroy()
991 ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) in ipv6_link_dev_addr() argument
1000 list_for_each(p, &idev->addr_list) { in ipv6_link_dev_addr()
1024 if (!dev || ifp->idev->dev == dev) in ipv6_chk_same_addr()
1055 ipv6_add_addr(struct inet6_dev *idev, struct ifa6_config *cfg, in ipv6_add_addr() argument
1060 struct net *net = dev_net(idev->dev); in ipv6_add_addr()
1068 (!(idev->dev->flags & IFF_LOOPBACK) && in ipv6_add_addr()
1069 !netif_is_l3_master(idev->dev) && in ipv6_add_addr()
1073 if (idev->dead) { in ipv6_add_addr()
1078 if (idev->cnf.disable_ipv6) { in ipv6_add_addr()
1089 .i6vi_dev = idev, in ipv6_add_addr()
1105 f6i = addrconf_f6i_alloc(net, idev, cfg->pfx, false, gfp_flags); in ipv6_add_addr()
1112 neigh_parms_data_state_setall(idev->nd_parms); in ipv6_add_addr()
1136 ifa->idev = idev; in ipv6_add_addr()
1137 in6_dev_hold(idev); in ipv6_add_addr()
1144 err = ipv6_add_addr_hash(idev->dev, ifa); in ipv6_add_addr()
1150 write_lock(&idev->lock); in ipv6_add_addr()
1153 ipv6_link_dev_addr(idev, ifa); in ipv6_add_addr()
1156 list_add(&ifa->tmp_list, &idev->tempaddr_list); in ipv6_add_addr()
1161 write_unlock(&idev->lock); in ipv6_add_addr()
1171 if (ifa->idev) in ipv6_add_addr()
1172 in6_dev_put(ifa->idev); in ipv6_add_addr()
1209 struct inet6_dev *idev = ifp->idev; in check_cleanup_prefix_route() local
1215 list_for_each_entry(ifa, &idev->addr_list, if_list) { in check_cleanup_prefix_route()
1251 ifp->idev->dev, 0, RTF_DEFAULT, true); in cleanup_prefix_route()
1254 ip6_del_rt(dev_net(ifp->idev->dev), f6i, false); in cleanup_prefix_route()
1269 struct net *net = dev_net(ifp->idev->dev); in ipv6_del_addr()
1287 write_lock_bh(&ifp->idev->lock); in ipv6_del_addr()
1304 write_unlock_bh(&ifp->idev->lock); in ipv6_del_addr()
1325 struct inet6_dev *idev = ifp->idev; in ipv6_create_tempaddr() local
1336 write_lock_bh(&idev->lock); in ipv6_create_tempaddr()
1339 in6_dev_hold(idev); in ipv6_create_tempaddr()
1340 if (idev->cnf.use_tempaddr <= 0) { in ipv6_create_tempaddr()
1341 write_unlock_bh(&idev->lock); in ipv6_create_tempaddr()
1343 in6_dev_put(idev); in ipv6_create_tempaddr()
1348 if (ifp->regen_count++ >= idev->cnf.regen_max_retry) { in ipv6_create_tempaddr()
1349 idev->cnf.use_tempaddr = -1; /*XXX*/ in ipv6_create_tempaddr()
1351 write_unlock_bh(&idev->lock); in ipv6_create_tempaddr()
1354 in6_dev_put(idev); in ipv6_create_tempaddr()
1364 regen_advance = idev->cnf.regen_max_retry * in ipv6_create_tempaddr()
1365 idev->cnf.dad_transmits * in ipv6_create_tempaddr()
1366 max(NEIGH_VAR(idev->nd_parms, RETRANS_TIME), HZ/100) / HZ; in ipv6_create_tempaddr()
1371 cnf_temp_preferred_lft = READ_ONCE(idev->cnf.temp_prefered_lft); in ipv6_create_tempaddr()
1373 idev->cnf.max_desync_factor, in ipv6_create_tempaddr()
1376 if (unlikely(idev->desync_factor > max_desync_factor)) { in ipv6_create_tempaddr()
1378 get_random_bytes(&idev->desync_factor, in ipv6_create_tempaddr()
1379 sizeof(idev->desync_factor)); in ipv6_create_tempaddr()
1380 idev->desync_factor %= max_desync_factor; in ipv6_create_tempaddr()
1382 idev->desync_factor = 0; in ipv6_create_tempaddr()
1388 idev->cnf.temp_valid_lft + age); in ipv6_create_tempaddr()
1389 cfg.preferred_lft = cnf_temp_preferred_lft + age - idev->desync_factor; in ipv6_create_tempaddr()
1396 write_unlock_bh(&idev->lock); in ipv6_create_tempaddr()
1408 in6_dev_put(idev); in ipv6_create_tempaddr()
1421 ift = ipv6_add_addr(idev, &cfg, block, NULL); in ipv6_create_tempaddr()
1424 in6_dev_put(idev); in ipv6_create_tempaddr()
1426 write_lock_bh(&idev->lock); in ipv6_create_tempaddr()
1438 in6_dev_put(idev); in ipv6_create_tempaddr()
1490 struct inet6_dev *idev) in ipv6_use_optimistic_addr() argument
1493 if (!idev) in ipv6_use_optimistic_addr()
1495 if (!net->ipv6.devconf_all->optimistic_dad && !idev->cnf.optimistic_dad) in ipv6_use_optimistic_addr()
1497 if (!net->ipv6.devconf_all->use_optimistic && !idev->cnf.use_optimistic) in ipv6_use_optimistic_addr()
1507 struct inet6_dev *idev) in ipv6_allow_optimistic_dad() argument
1510 if (!idev) in ipv6_allow_optimistic_dad()
1512 if (!net->ipv6.devconf_all->optimistic_dad && !idev->cnf.optimistic_dad) in ipv6_allow_optimistic_dad()
1585 if (!ipv6_use_optimistic_addr(net, score->ifa->idev)) in ipv6_get_saddr_eval()
1603 dst->ifindex == score->ifa->idev->dev->ifindex); in ipv6_get_saddr_eval()
1609 score->ifa->idev->dev->ifindex) == dst->label; in ipv6_get_saddr_eval()
1618 score->ifa->idev->cnf.use_tempaddr >= 2; in ipv6_get_saddr_eval()
1657 struct inet6_dev *idev, in __ipv6_dev_get_saddr() argument
1663 list_for_each_entry_rcu(score->ifa, &idev->addr_list, if_list) { in __ipv6_dev_get_saddr()
1685 idev->dev->name); in __ipv6_dev_get_saddr()
1734 struct inet6_dev *idev; in ipv6_get_saddr_master() local
1736 idev = __in6_dev_get(dst_dev); in ipv6_get_saddr_master()
1737 if (idev) in ipv6_get_saddr_master()
1738 hiscore_idx = __ipv6_dev_get_saddr(net, dst, idev, in ipv6_get_saddr_master()
1741 idev = __in6_dev_get(master); in ipv6_get_saddr_master()
1742 if (idev) in ipv6_get_saddr_master()
1743 hiscore_idx = __ipv6_dev_get_saddr(net, dst, idev, in ipv6_get_saddr_master()
1755 struct inet6_dev *idev; in ipv6_dev_get_saddr() local
1791 idev = __in6_dev_get(dst_dev); in ipv6_dev_get_saddr()
1794 (idev && idev->cnf.use_oif_addrs_only)) { in ipv6_dev_get_saddr()
1800 if (idev) in ipv6_dev_get_saddr()
1801 hiscore_idx = __ipv6_dev_get_saddr(net, &dst, idev, scores, hiscore_idx); in ipv6_dev_get_saddr()
1828 idev = __in6_dev_get(dev); in ipv6_dev_get_saddr()
1829 if (!idev) in ipv6_dev_get_saddr()
1831 hiscore_idx = __ipv6_dev_get_saddr(net, &dst, idev, scores, hiscore_idx); in ipv6_dev_get_saddr()
1847 static int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, in __ipv6_get_lladdr() argument
1853 list_for_each_entry_reverse(ifp, &idev->addr_list, if_list) { in __ipv6_get_lladdr()
1869 struct inet6_dev *idev; in ipv6_get_lladdr() local
1873 idev = __in6_dev_get(dev); in ipv6_get_lladdr()
1874 if (idev) { in ipv6_get_lladdr()
1875 read_lock_bh(&idev->lock); in ipv6_get_lladdr()
1876 err = __ipv6_get_lladdr(idev, addr, banned_flags); in ipv6_get_lladdr()
1877 read_unlock_bh(&idev->lock); in ipv6_get_lladdr()
1883 static int ipv6_count_addresses(const struct inet6_dev *idev) in ipv6_count_addresses() argument
1889 list_for_each_entry_rcu(ifp, &idev->addr_list, if_list) in ipv6_count_addresses()
1929 ndev = ifp->idev->dev; in __ipv6_chk_addr_and_flags()
1970 const struct inet6_dev *idev; in ipv6_chk_custom_prefix() local
1974 idev = __in6_dev_get(dev); in ipv6_chk_custom_prefix()
1975 if (idev) { in ipv6_chk_custom_prefix()
1976 list_for_each_entry_rcu(ifa, &idev->addr_list, if_list) { in ipv6_chk_custom_prefix()
1991 const struct inet6_dev *idev; in ipv6_chk_prefix() local
1996 idev = __in6_dev_get(dev); in ipv6_chk_prefix()
1997 if (idev) { in ipv6_chk_prefix()
1998 list_for_each_entry_rcu(ifa, &idev->addr_list, if_list) { in ipv6_chk_prefix()
2035 if (!dev || ifp->idev->dev == dev || in ipv6_get_ifaddr()
2099 struct inet6_dev *idev = ifp->idev; in addrconf_dad_failure() local
2100 struct net *net = dev_net(idev->dev); in addrconf_dad_failure()
2108 ifp->idev->dev->name, &ifp->addr, eth_hdr(skb)->h_source); in addrconf_dad_failure()
2127 ifp->idev->dev->name); in addrconf_dad_failure()
2133 idev)) in addrconf_dad_failure()
2138 if (idev->cnf.max_addresses && in addrconf_dad_failure()
2139 ipv6_count_addresses(idev) >= in addrconf_dad_failure()
2140 idev->cnf.max_addresses) in addrconf_dad_failure()
2144 ifp->idev->dev->name); in addrconf_dad_failure()
2146 ifp2 = ipv6_add_addr(idev, &cfg, false, NULL); in addrconf_dad_failure()
2184 void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr) in addrconf_leave_solict() argument
2188 if (idev->dev->flags&(IFF_LOOPBACK|IFF_NOARP)) in addrconf_leave_solict()
2192 __ipv6_dev_mc_dec(idev, &maddr); in addrconf_leave_solict()
2205 __ipv6_dev_ac_inc(ifp->idev, &addr); in addrconf_join_anycast()
2218 __ipv6_dev_ac_dec(ifp->idev, &addr); in addrconf_leave_anycast()
2340 static int ipv6_inherit_eui64(u8 *eui, struct inet6_dev *idev) in ipv6_inherit_eui64() argument
2345 read_lock_bh(&idev->lock); in ipv6_inherit_eui64()
2346 list_for_each_entry_reverse(ifp, &idev->addr_list, if_list) { in ipv6_inherit_eui64()
2355 read_unlock_bh(&idev->lock); in ipv6_inherit_eui64()
2494 struct inet6_dev *idev; in addrconf_add_dev() local
2498 idev = ipv6_find_idev(dev); in addrconf_add_dev()
2499 if (IS_ERR(idev)) in addrconf_add_dev()
2500 return idev; in addrconf_add_dev()
2502 if (idev->cnf.disable_ipv6) in addrconf_add_dev()
2509 return idev; in addrconf_add_dev()
2512 static void manage_tempaddrs(struct inet6_dev *idev, in manage_tempaddrs() argument
2520 read_lock_bh(&idev->lock); in manage_tempaddrs()
2522 list_for_each_entry(ift, &idev->tempaddr_list, tmp_list) { in manage_tempaddrs()
2537 max_valid = idev->cnf.temp_valid_lft - age; in manage_tempaddrs()
2541 max_prefered = idev->cnf.temp_prefered_lft - in manage_tempaddrs()
2542 idev->desync_factor - age; in manage_tempaddrs()
2565 if ((create || list_empty(&idev->tempaddr_list)) && in manage_tempaddrs()
2566 idev->cnf.use_tempaddr > 0) { in manage_tempaddrs()
2572 read_unlock_bh(&idev->lock); in manage_tempaddrs()
2575 read_unlock_bh(&idev->lock); in manage_tempaddrs()
2579 static bool is_addr_mode_generate_stable(struct inet6_dev *idev) in is_addr_mode_generate_stable() argument
2581 return idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_STABLE_PRIVACY || in is_addr_mode_generate_stable()
2582 idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_RANDOM; in is_addr_mode_generate_stable()
2915 struct inet6_dev *idev; in inet6_addr_add() local
2937 idev = addrconf_add_dev(dev); in inet6_addr_add()
2938 if (IS_ERR(idev)) in inet6_addr_add()
2939 return PTR_ERR(idev); in inet6_addr_add()
2969 ifp = ipv6_add_addr(idev, cfg, true, extack); in inet6_addr_add()
2989 manage_tempaddrs(idev, ifp, cfg->valid_lft, in inet6_addr_add()
3006 struct inet6_dev *idev; in inet6_addr_del() local
3016 idev = __in6_dev_get(dev); in inet6_addr_del()
3017 if (!idev) in inet6_addr_del()
3020 read_lock_bh(&idev->lock); in inet6_addr_del()
3021 list_for_each_entry(ifp, &idev->addr_list, if_list) { in inet6_addr_del()
3025 read_unlock_bh(&idev->lock); in inet6_addr_del()
3029 manage_tempaddrs(idev, ifp, 0, 0, false, in inet6_addr_del()
3040 read_unlock_bh(&idev->lock); in inet6_addr_del()
3088 static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr, in add_addr() argument
3102 ifp = ipv6_add_addr(idev, &cfg, true, NULL); in add_addr()
3107 rt_genid_bump_ipv6(dev_net(idev->dev)); in add_addr()
3114 static void add_v4_addrs(struct inet6_dev *idev) in add_v4_addrs() argument
3118 struct net *net = dev_net(idev->dev); in add_v4_addrs()
3126 if (idev->dev->addr_len == sizeof(struct in6_addr)) in add_v4_addrs()
3128 memcpy(&addr.s6_addr32[3], idev->dev->dev_addr + offset, 4); in add_v4_addrs()
3130 if (idev->dev->flags&IFF_POINTOPOINT) { in add_v4_addrs()
3131 if (idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_NONE) in add_v4_addrs()
3144 add_addr(idev, &addr, plen, scope, IFAPROT_UNSPEC); in add_v4_addrs()
3145 addrconf_prefix_route(&addr, plen, 0, idev->dev, 0, pflags, in add_v4_addrs()
3162 if (idev->dev->flags&IFF_POINTOPOINT) in add_v4_addrs()
3167 add_addr(idev, &addr, plen, flag, in add_v4_addrs()
3169 addrconf_prefix_route(&addr, plen, 0, idev->dev, in add_v4_addrs()
3179 struct inet6_dev *idev; in init_loopback() local
3185 idev = ipv6_find_idev(dev); in init_loopback()
3186 if (IS_ERR(idev)) { in init_loopback()
3191 add_addr(idev, &in6addr_loopback, 128, IFA_HOST, IFAPROT_KERNEL_LO); in init_loopback()
3194 void addrconf_add_linklocal(struct inet6_dev *idev, in addrconf_add_linklocal() argument
3209 if ((dev_net(idev->dev)->ipv6.devconf_all->optimistic_dad || in addrconf_add_linklocal()
3210 idev->cnf.optimistic_dad) && in addrconf_add_linklocal()
3211 !dev_net(idev->dev)->ipv6.devconf_all->forwarding) in addrconf_add_linklocal()
3215 ifp = ipv6_add_addr(idev, &cfg, true, NULL); in addrconf_add_linklocal()
3217 addrconf_prefix_route(&ifp->addr, ifp->prefix_len, 0, idev->dev, in addrconf_add_linklocal()
3243 const struct inet6_dev *idev) in ipv6_generate_stable_address() argument
3261 struct net *net = dev_net(idev->dev); in ipv6_generate_stable_address()
3265 if (idev->cnf.stable_secret.initialized) in ipv6_generate_stable_address()
3266 secret = idev->cnf.stable_secret.secret; in ipv6_generate_stable_address()
3278 memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len); in ipv6_generate_stable_address()
3294 if (dad_count > dev_net(idev->dev)->ipv6.sysctl.idgen_retries) in ipv6_generate_stable_address()
3303 static void ipv6_gen_mode_random_init(struct inet6_dev *idev) in ipv6_gen_mode_random_init() argument
3305 struct ipv6_stable_secret *s = &idev->cnf.stable_secret; in ipv6_gen_mode_random_init()
3309 s = &idev->cnf.stable_secret; in ipv6_gen_mode_random_init()
3314 static void addrconf_addr_gen(struct inet6_dev *idev, bool prefix_route) in addrconf_addr_gen() argument
3319 if (netif_is_l3_master(idev->dev)) in addrconf_addr_gen()
3323 if (idev->dev->flags & IFF_SLAVE) in addrconf_addr_gen()
3328 switch (idev->cnf.addr_gen_mode) { in addrconf_addr_gen()
3330 ipv6_gen_mode_random_init(idev); in addrconf_addr_gen()
3333 if (!ipv6_generate_stable_address(&addr, 0, idev)) in addrconf_addr_gen()
3334 addrconf_add_linklocal(idev, &addr, in addrconf_addr_gen()
3337 addrconf_prefix_route(&addr, 64, 0, idev->dev, in addrconf_addr_gen()
3345 if (ipv6_generate_eui64(addr.s6_addr + 8, idev->dev) == 0) in addrconf_addr_gen()
3346 addrconf_add_linklocal(idev, &addr, 0); in addrconf_addr_gen()
3348 addrconf_prefix_route(&addr, 64, 0, idev->dev, in addrconf_addr_gen()
3360 struct inet6_dev *idev; in addrconf_dev_config() local
3375 idev = __in6_dev_get(dev); in addrconf_dev_config()
3376 if (!IS_ERR_OR_NULL(idev) && dev->flags & IFF_UP && in addrconf_dev_config()
3378 ipv6_mc_up(idev); in addrconf_dev_config()
3382 idev = addrconf_add_dev(dev); in addrconf_dev_config()
3383 if (IS_ERR(idev)) in addrconf_dev_config()
3388 idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64) in addrconf_dev_config()
3389 idev->cnf.addr_gen_mode = IN6_ADDR_GEN_MODE_RANDOM; in addrconf_dev_config()
3391 addrconf_addr_gen(idev, false); in addrconf_dev_config()
3397 struct inet6_dev *idev; in addrconf_sit_config() local
3407 idev = ipv6_find_idev(dev); in addrconf_sit_config()
3408 if (IS_ERR(idev)) { in addrconf_sit_config()
3414 addrconf_addr_gen(idev, false); in addrconf_sit_config()
3418 add_v4_addrs(idev); in addrconf_sit_config()
3428 struct inet6_dev *idev; in addrconf_gre_config() local
3432 idev = ipv6_find_idev(dev); in addrconf_gre_config()
3433 if (IS_ERR(idev)) { in addrconf_gre_config()
3439 addrconf_addr_gen(idev, true); in addrconf_gre_config()
3443 add_v4_addrs(idev); in addrconf_gre_config()
3451 struct inet6_dev *idev, in fixup_permanent_addr() argument
3461 f6i = addrconf_f6i_alloc(net, idev, &ifp->addr, false, in fixup_permanent_addr()
3477 ifp->rt_priority, idev->dev, 0, 0, in fixup_permanent_addr()
3490 struct inet6_dev *idev; in addrconf_permanent_addr() local
3492 idev = __in6_dev_get(dev); in addrconf_permanent_addr()
3493 if (!idev) in addrconf_permanent_addr()
3496 write_lock_bh(&idev->lock); in addrconf_permanent_addr()
3498 list_for_each_entry_safe(ifp, tmp, &idev->addr_list, if_list) { in addrconf_permanent_addr()
3500 fixup_permanent_addr(net, idev, ifp) < 0) { in addrconf_permanent_addr()
3501 write_unlock_bh(&idev->lock); in addrconf_permanent_addr()
3504 write_lock_bh(&idev->lock); in addrconf_permanent_addr()
3507 idev->dev->name, &ifp->addr); in addrconf_permanent_addr()
3511 write_unlock_bh(&idev->lock); in addrconf_permanent_addr()
3520 struct inet6_dev *idev = __in6_dev_get(dev); in addrconf_notify() local
3527 if (!idev && dev->mtu >= IPV6_MIN_MTU) { in addrconf_notify()
3528 idev = ipv6_add_dev(dev); in addrconf_notify()
3529 if (IS_ERR(idev)) in addrconf_notify()
3530 return notifier_from_errno(PTR_ERR(idev)); in addrconf_notify()
3541 if (idev) { in addrconf_notify()
3543 idev->cnf.mtu6 = dev->mtu; in addrconf_notify()
3548 idev = ipv6_add_dev(dev); in addrconf_notify()
3549 if (IS_ERR(idev)) in addrconf_notify()
3553 if (!(idev->if_flags & IF_READY)) in addrconf_notify()
3560 if (idev && idev->cnf.disable_ipv6) in addrconf_notify()
3564 if (event == NETDEV_UP && !IS_ERR_OR_NULL(idev) && in addrconf_notify()
3566 ipv6_mc_up(idev); in addrconf_notify()
3581 if (!idev && dev->mtu >= IPV6_MIN_MTU) in addrconf_notify()
3582 idev = ipv6_add_dev(dev); in addrconf_notify()
3584 if (!IS_ERR_OR_NULL(idev)) { in addrconf_notify()
3585 idev->if_flags |= IF_READY; in addrconf_notify()
3595 if (!IS_ERR_OR_NULL(idev)) { in addrconf_notify()
3596 if (idev->if_flags & IF_READY) { in addrconf_notify()
3602 ipv6_mc_up(idev); in addrconf_notify()
3605 addrconf_dad_run(idev, true); in addrconf_notify()
3609 idev->if_flags |= IF_READY; in addrconf_notify()
3639 if (!IS_ERR_OR_NULL(idev)) { in addrconf_notify()
3641 addrconf_dad_run(idev, false); in addrconf_notify()
3651 if (idev->cnf.mtu6 != dev->mtu && in addrconf_notify()
3654 idev->cnf.mtu6 = dev->mtu; in addrconf_notify()
3656 idev->tstamp = jiffies; in addrconf_notify()
3657 inet6_ifinfo_notify(RTM_NEWLINK, idev); in addrconf_notify()
3677 if (idev) { in addrconf_notify()
3678 snmp6_unregister_dev(idev); in addrconf_notify()
3679 addrconf_sysctl_unregister(idev); in addrconf_notify()
3680 err = addrconf_sysctl_register(idev); in addrconf_notify()
3683 err = snmp6_register_dev(idev); in addrconf_notify()
3685 addrconf_sysctl_unregister(idev); in addrconf_notify()
3693 if (idev) in addrconf_notify()
3720 struct inet6_dev *idev; in addrconf_type_change() local
3723 idev = __in6_dev_get(dev); in addrconf_type_change()
3726 ipv6_mc_remap(idev); in addrconf_type_change()
3728 ipv6_mc_unmap(idev); in addrconf_type_change()
3741 struct inet6_dev *idev; in addrconf_ifdown() local
3752 idev = __in6_dev_get(dev); in addrconf_ifdown()
3753 if (!idev) in addrconf_ifdown()
3761 idev->dead = 1; in addrconf_ifdown()
3767 snmp6_unregister_dev(idev); in addrconf_ifdown()
3774 if (!unregister && !idev->cnf.disable_ipv6) { in addrconf_ifdown()
3779 _keep_addr = idev->cnf.keep_addr_on_down; in addrconf_ifdown()
3791 if (ifa->idev == idev) { in addrconf_ifdown()
3807 write_lock_bh(&idev->lock); in addrconf_ifdown()
3809 addrconf_del_rs_timer(idev); in addrconf_ifdown()
3814 was_ready = idev->if_flags & IF_READY; in addrconf_ifdown()
3816 idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); in addrconf_ifdown()
3819 while (!list_empty(&idev->tempaddr_list)) { in addrconf_ifdown()
3820 ifa = list_first_entry(&idev->tempaddr_list, in addrconf_ifdown()
3823 write_unlock_bh(&idev->lock); in addrconf_ifdown()
3832 write_lock_bh(&idev->lock); in addrconf_ifdown()
3835 list_for_each_entry(ifa, &idev->addr_list, if_list) in addrconf_ifdown()
3837 write_unlock_bh(&idev->lock); in addrconf_ifdown()
3877 if (idev->cnf.forwarding) in addrconf_ifdown()
3879 addrconf_leave_solict(ifa->idev, &ifa->addr); in addrconf_ifdown()
3883 write_lock_bh(&idev->lock); in addrconf_ifdown()
3885 write_unlock_bh(&idev->lock); in addrconf_ifdown()
3892 ipv6_ac_destroy_dev(idev); in addrconf_ifdown()
3893 ipv6_mc_destroy_dev(idev); in addrconf_ifdown()
3895 ipv6_mc_down(idev); in addrconf_ifdown()
3898 idev->tstamp = jiffies; in addrconf_ifdown()
3899 idev->ra_mtu = 0; in addrconf_ifdown()
3903 addrconf_sysctl_unregister(idev); in addrconf_ifdown()
3904 neigh_parms_release(&nd_tbl, idev->nd_parms); in addrconf_ifdown()
3906 in6_dev_put(idev); in addrconf_ifdown()
3913 struct inet6_dev *idev = from_timer(idev, t, rs_timer); in addrconf_rs_timer() local
3914 struct net_device *dev = idev->dev; in addrconf_rs_timer()
3917 write_lock(&idev->lock); in addrconf_rs_timer()
3918 if (idev->dead || !(idev->if_flags & IF_READY)) in addrconf_rs_timer()
3921 if (!ipv6_accept_ra(idev)) in addrconf_rs_timer()
3925 if (idev->if_flags & IF_RA_RCVD) in addrconf_rs_timer()
3928 if (idev->rs_probes++ < idev->cnf.rtr_solicits || idev->cnf.rtr_solicits < 0) { in addrconf_rs_timer()
3929 write_unlock(&idev->lock); in addrconf_rs_timer()
3936 write_lock(&idev->lock); in addrconf_rs_timer()
3937 idev->rs_interval = rfc3315_s14_backoff_update( in addrconf_rs_timer()
3938 idev->rs_interval, idev->cnf.rtr_solicit_max_interval); in addrconf_rs_timer()
3940 addrconf_mod_rs_timer(idev, (idev->rs_probes == in addrconf_rs_timer()
3941 idev->cnf.rtr_solicits) ? in addrconf_rs_timer()
3942 idev->cnf.rtr_solicit_delay : in addrconf_rs_timer()
3943 idev->rs_interval); in addrconf_rs_timer()
3949 pr_debug("%s: no IPv6 routers present\n", idev->dev->name); in addrconf_rs_timer()
3953 write_unlock(&idev->lock); in addrconf_rs_timer()
3955 in6_dev_put(idev); in addrconf_rs_timer()
3964 struct inet6_dev *idev = ifp->idev; in addrconf_dad_kick() local
3970 rand_num = prandom_u32_max(idev->cnf.rtr_solicit_delay ?: 1); in addrconf_dad_kick()
3973 if (idev->cnf.enhanced_dad || in addrconf_dad_kick()
3974 dev_net(idev->dev)->ipv6.devconf_all->enhanced_dad) { in addrconf_dad_kick()
3980 ifp->dad_probes = idev->cnf.dad_transmits; in addrconf_dad_kick()
3986 struct inet6_dev *idev = ifp->idev; in addrconf_dad_begin() local
3987 struct net_device *dev = idev->dev; in addrconf_dad_begin()
3993 read_lock_bh(&idev->lock); in addrconf_dad_begin()
4001 idev->cnf.accept_dad < 1) || in addrconf_dad_begin()
4012 read_unlock_bh(&idev->lock); in addrconf_dad_begin()
4018 if (!(idev->if_flags & IF_READY)) { in addrconf_dad_begin()
4020 read_unlock_bh(&idev->lock); in addrconf_dad_begin()
4037 if (ipv6_use_optimistic_addr(net, idev)) { in addrconf_dad_begin()
4048 read_unlock_bh(&idev->lock); in addrconf_dad_begin()
4073 struct inet6_dev *idev = ifp->idev; in addrconf_dad_work() local
4093 if ((dev_net(idev->dev)->ipv6.devconf_all->accept_dad > 1 || in addrconf_dad_work()
4094 idev->cnf.accept_dad > 1) && in addrconf_dad_work()
4095 !idev->cnf.disable_ipv6 && in addrconf_dad_work()
4102 if (!ipv6_generate_eui64(addr.s6_addr + 8, idev->dev) && in addrconf_dad_work()
4105 idev->cnf.disable_ipv6 = 1; in addrconf_dad_work()
4108 ifp->idev->dev->name); in addrconf_dad_work()
4122 addrconf_ifdown(idev->dev, false); in addrconf_dad_work()
4129 write_lock_bh(&idev->lock); in addrconf_dad_work()
4130 if (idev->dead || !(idev->if_flags & IF_READY)) { in addrconf_dad_work()
4131 write_unlock_bh(&idev->lock); in addrconf_dad_work()
4138 write_unlock_bh(&idev->lock); in addrconf_dad_work()
4155 write_unlock_bh(&idev->lock); in addrconf_dad_work()
4164 max(NEIGH_VAR(ifp->idev->nd_parms, RETRANS_TIME), in addrconf_dad_work()
4167 write_unlock_bh(&idev->lock); in addrconf_dad_work()
4171 ndisc_send_ns(ifp->idev->dev, &ifp->addr, &mcaddr, &in6addr_any, in addrconf_dad_work()
4182 struct inet6_dev *idev = ifp->idev; in ipv6_lonely_lladdr() local
4184 list_for_each_entry_reverse(ifpiter, &idev->addr_list, if_list) { in ipv6_lonely_lladdr()
4199 struct net_device *dev = ifp->idev->dev; in addrconf_dad_completed()
4215 read_lock_bh(&ifp->idev->lock); in addrconf_dad_completed()
4218 ipv6_accept_ra(ifp->idev) && in addrconf_dad_completed()
4219 ifp->idev->cnf.rtr_solicits != 0 && in addrconf_dad_completed()
4222 read_unlock_bh(&ifp->idev->lock); in addrconf_dad_completed()
4228 ipv6_mc_dad_complete(ifp->idev); in addrconf_dad_completed()
4232 (ifp->idev->cnf.ndisc_notify || in addrconf_dad_completed()
4235 /*router=*/ !!ifp->idev->cnf.forwarding, in addrconf_dad_completed()
4250 write_lock_bh(&ifp->idev->lock); in addrconf_dad_completed()
4252 ifp->idev->rs_interval = rfc3315_s14_backoff_init( in addrconf_dad_completed()
4253 ifp->idev->cnf.rtr_solicit_interval); in addrconf_dad_completed()
4254 ifp->idev->rs_probes = 1; in addrconf_dad_completed()
4255 ifp->idev->if_flags |= IF_RS_SENT; in addrconf_dad_completed()
4256 addrconf_mod_rs_timer(ifp->idev, ifp->idev->rs_interval); in addrconf_dad_completed()
4258 write_unlock_bh(&ifp->idev->lock); in addrconf_dad_completed()
4271 static void addrconf_dad_run(struct inet6_dev *idev, bool restart) in addrconf_dad_run() argument
4275 read_lock_bh(&idev->lock); in addrconf_dad_run()
4276 list_for_each_entry(ifp, &idev->addr_list, if_list) { in addrconf_dad_run()
4286 read_unlock_bh(&idev->lock); in addrconf_dad_run()
4376 ifp->idev->dev->ifindex, in if6_seq_show()
4380 ifp->idev->dev->name); in if6_seq_show()
4533 unsigned long regen_advance = ifp->idev->cnf.regen_max_retry * in addrconf_verify_rtnl()
4534 ifp->idev->cnf.dad_transmits * in addrconf_verify_rtnl()
4535 max(NEIGH_VAR(ifp->idev->nd_parms, RETRANS_TIME), HZ/100) / HZ; in addrconf_verify_rtnl()
4702 ifp->idev->dev, 0, RTF_DEFAULT, true); in modify_prefix_route()
4709 ip6_del_rt(dev_net(ifp->idev->dev), f6i, false); in modify_prefix_route()
4714 ifp->rt_priority, ifp->idev->dev, in modify_prefix_route()
4807 ifp->rt_priority, ifp->idev->dev, in inet6_addr_modify()
4816 ifp->rt_priority, ifp->idev->dev, in inet6_addr_modify()
4823 write_lock_bh(&ifp->idev->lock); in inet6_addr_modify()
4825 write_unlock_bh(&ifp->idev->lock); in inet6_addr_modify()
4839 manage_tempaddrs(ifp->idev, ifp, cfg->valid_lft, in inet6_addr_modify()
4859 struct inet6_dev *idev; in inet6_rtm_newaddr() local
4908 idev = ipv6_find_idev(dev); in inet6_rtm_newaddr()
4909 if (IS_ERR(idev)) in inet6_rtm_newaddr()
4910 return PTR_ERR(idev); in inet6_rtm_newaddr()
4912 if (!ipv6_allow_optimistic_dad(net, idev)) in inet6_rtm_newaddr()
5018 ifa->idev->dev->ifindex); in inet6_fill_ifaddr()
5083 int ifindex = ifmca->idev->dev->ifindex; in inet6_fill_ifmcaddr()
5146 static int in6_dump_addrs(struct inet6_dev *idev, struct sk_buff *skb, in in6_dump_addrs() argument
5155 read_lock_bh(&idev->lock); in in6_dump_addrs()
5162 list_for_each_entry(ifa, &idev->addr_list, if_list) { in in6_dump_addrs()
5175 read_unlock_bh(&idev->lock); in in6_dump_addrs()
5179 for (ifmca = rtnl_dereference(idev->mc_list); in in6_dump_addrs()
5188 read_lock_bh(&idev->lock); in in6_dump_addrs()
5193 for (ifaca = idev->ac_list; ifaca; in in6_dump_addrs()
5205 read_unlock_bh(&idev->lock); in in6_dump_addrs()
5281 struct inet6_dev *idev; in inet6_dump_addr() local
5302 idev = __in6_dev_get(dev); in inet6_dump_addr()
5303 if (idev) { in inet6_dump_addr()
5304 err = in6_dump_addrs(idev, skb, cb, s_ip_idx, in inet6_dump_addr()
5323 idev = __in6_dev_get(dev); in inet6_dump_addr()
5324 if (!idev) in inet6_dump_addr()
5327 if (in6_dump_addrs(idev, skb, cb, s_ip_idx, in inet6_dump_addr()
5486 struct net *net = dev_net(ifa->idev->dev); in inet6_ifa_notify()
5656 static void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype, in snmp6_fill_stats() argument
5661 __snmp6_fill_stats64(stats, idev->stats.ipv6, bytes, in snmp6_fill_stats()
5665 __snmp6_fill_statsdev(stats, idev->stats.icmpv6dev->mibs, bytes); in snmp6_fill_stats()
5670 static int inet6_fill_ifla6_attrs(struct sk_buff *skb, struct inet6_dev *idev, in inet6_fill_ifla6_attrs() argument
5676 if (nla_put_u32(skb, IFLA_INET6_FLAGS, idev->if_flags)) in inet6_fill_ifla6_attrs()
5679 ci.tstamp = cstamp_delta(idev->tstamp); in inet6_fill_ifla6_attrs()
5680 ci.reachable_time = jiffies_to_msecs(idev->nd_parms->reachable_time); in inet6_fill_ifla6_attrs()
5681 ci.retrans_time = jiffies_to_msecs(NEIGH_VAR(idev->nd_parms, RETRANS_TIME)); in inet6_fill_ifla6_attrs()
5687 ipv6_store_devconf(&idev->cnf, nla_data(nla), nla_len(nla)); in inet6_fill_ifla6_attrs()
5697 snmp6_fill_stats(nla_data(nla), idev, IFLA_INET6_STATS, nla_len(nla)); in inet6_fill_ifla6_attrs()
5702 snmp6_fill_stats(nla_data(nla), idev, IFLA_INET6_ICMP6STATS, nla_len(nla)); in inet6_fill_ifla6_attrs()
5707 read_lock_bh(&idev->lock); in inet6_fill_ifla6_attrs()
5708 memcpy(nla_data(nla), idev->token.s6_addr, nla_len(nla)); in inet6_fill_ifla6_attrs()
5709 read_unlock_bh(&idev->lock); in inet6_fill_ifla6_attrs()
5711 if (nla_put_u8(skb, IFLA_INET6_ADDR_GEN_MODE, idev->cnf.addr_gen_mode)) in inet6_fill_ifla6_attrs()
5714 if (idev->ra_mtu && in inet6_fill_ifla6_attrs()
5715 nla_put_u32(skb, IFLA_INET6_RA_MTU, idev->ra_mtu)) in inet6_fill_ifla6_attrs()
5736 struct inet6_dev *idev = __in6_dev_get(dev); in inet6_fill_link_af() local
5738 if (!idev) in inet6_fill_link_af()
5741 if (inet6_fill_ifla6_attrs(skb, idev, ext_filter_mask) < 0) in inet6_fill_link_af()
5747 static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token, in inet6_set_iftoken() argument
5751 struct net_device *dev = idev->dev; in inet6_set_iftoken()
5771 if (!ipv6_accept_ra(idev)) { in inet6_set_iftoken()
5777 if (idev->cnf.rtr_solicits == 0) { in inet6_set_iftoken()
5783 write_lock_bh(&idev->lock); in inet6_set_iftoken()
5786 memcpy(idev->token.s6_addr + 8, token->s6_addr + 8, 8); in inet6_set_iftoken()
5788 write_unlock_bh(&idev->lock); in inet6_set_iftoken()
5794 if (!idev->dead && (idev->if_flags & IF_READY) && in inet6_set_iftoken()
5805 write_lock_bh(&idev->lock); in inet6_set_iftoken()
5808 idev->if_flags |= IF_RS_SENT; in inet6_set_iftoken()
5809 idev->rs_interval = rfc3315_s14_backoff_init( in inet6_set_iftoken()
5810 idev->cnf.rtr_solicit_interval); in inet6_set_iftoken()
5811 idev->rs_probes = 1; in inet6_set_iftoken()
5812 addrconf_mod_rs_timer(idev, idev->rs_interval); in inet6_set_iftoken()
5816 list_for_each_entry(ifp, &idev->addr_list, if_list) { in inet6_set_iftoken()
5825 write_unlock_bh(&idev->lock); in inet6_set_iftoken()
5826 inet6_ifinfo_notify(RTM_NEWLINK, idev); in inet6_set_iftoken()
5849 static int check_stable_privacy(struct inet6_dev *idev, struct net *net, in check_stable_privacy() argument
5853 !idev->cnf.stable_secret.initialized && in check_stable_privacy()
5864 struct inet6_dev *idev = NULL; in inet6_validate_link_af() local
5868 idev = __in6_dev_get(dev); in inet6_validate_link_af()
5869 if (!idev) in inet6_validate_link_af()
5886 if (dev && check_stable_privacy(idev, dev_net(dev), mode) < 0) in inet6_validate_link_af()
5896 struct inet6_dev *idev = __in6_dev_get(dev); in inet6_set_link_af() local
5900 if (!idev) in inet6_set_link_af()
5907 err = inet6_set_iftoken(idev, nla_data(tb[IFLA_INET6_TOKEN]), in inet6_set_link_af()
5916 idev->cnf.addr_gen_mode = mode; in inet6_set_link_af()
5922 static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, in inet6_fill_ifinfo() argument
5925 struct net_device *dev = idev->dev; in inet6_fill_ifinfo()
5955 if (inet6_fill_ifla6_attrs(skb, idev, 0) < 0) in inet6_fill_ifinfo()
5998 struct inet6_dev *idev; in inet6_dump_ifinfo() local
6021 idev = __in6_dev_get(dev); in inet6_dump_ifinfo()
6022 if (!idev) in inet6_dump_ifinfo()
6024 if (inet6_fill_ifinfo(skb, idev, in inet6_dump_ifinfo()
6041 void inet6_ifinfo_notify(int event, struct inet6_dev *idev) in inet6_ifinfo_notify() argument
6044 struct net *net = dev_net(idev->dev); in inet6_ifinfo_notify()
6051 err = inet6_fill_ifinfo(skb, idev, 0, 0, event, 0); in inet6_ifinfo_notify()
6072 static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev, in inet6_fill_prefix() argument
6088 pmsg->prefix_ifindex = idev->dev->ifindex; in inet6_fill_prefix()
6112 static void inet6_prefix_notify(int event, struct inet6_dev *idev, in inet6_prefix_notify() argument
6116 struct net *net = dev_net(idev->dev); in inet6_prefix_notify()
6123 err = inet6_fill_prefix(skb, idev, pinfo, 0, 0, event, 0); in inet6_prefix_notify()
6139 struct net *net = dev_net(ifp->idev->dev); in __ipv6_ifa_notify()
6158 } else if (!ifp->rt && (ifp->idev->dev->flags & IFF_UP)) { in __ipv6_ifa_notify()
6160 &ifp->addr, ifp->idev->dev->name); in __ipv6_ifa_notify()
6163 if (ifp->idev->cnf.forwarding) in __ipv6_ifa_notify()
6167 ifp->rt_priority, ifp->idev->dev, in __ipv6_ifa_notify()
6171 if (ifp->idev->cnf.forwarding) in __ipv6_ifa_notify()
6173 addrconf_leave_solict(ifp->idev, &ifp->addr); in __ipv6_ifa_notify()
6178 ifp->idev->dev, 0, 0, in __ipv6_ifa_notify()
6195 if (likely(ifp->idev->dead == 0)) in ipv6_ifa_notify()
6229 struct inet6_dev *idev = ctl->extra1; in addrconf_sysctl_mtu() local
6235 lctl.extra2 = idev ? &idev->dev->mtu : NULL; in addrconf_sysctl_mtu()
6240 static void dev_disable_change(struct inet6_dev *idev) in dev_disable_change() argument
6244 if (!idev || !idev->dev) in dev_disable_change()
6247 netdev_notifier_info_init(&info, idev->dev); in dev_disable_change()
6248 if (idev->cnf.disable_ipv6) in dev_disable_change()
6257 struct inet6_dev *idev; in addrconf_disable_change() local
6260 idev = __in6_dev_get(dev); in addrconf_disable_change()
6261 if (idev) { in addrconf_disable_change()
6262 int changed = (!idev->cnf.disable_ipv6) ^ (!newf); in addrconf_disable_change()
6263 idev->cnf.disable_ipv6 = newf; in addrconf_disable_change()
6265 dev_disable_change(idev); in addrconf_disable_change()
6350 struct inet6_dev *idev = ctl->extra1; in addrconf_sysctl_proxy_ndp() local
6354 idev->dev->ifindex, in addrconf_sysctl_proxy_ndp()
6355 &idev->cnf); in addrconf_sysctl_proxy_ndp()
6369 struct inet6_dev *idev = (struct inet6_dev *)ctl->extra1; in addrconf_sysctl_addr_gen_mode() local
6392 if (idev) { in addrconf_sysctl_addr_gen_mode()
6393 if (check_stable_privacy(idev, net, new_val) < 0) { in addrconf_sysctl_addr_gen_mode()
6398 if (idev->cnf.addr_gen_mode != new_val) { in addrconf_sysctl_addr_gen_mode()
6399 idev->cnf.addr_gen_mode = new_val; in addrconf_sysctl_addr_gen_mode()
6400 addrconf_dev_config(idev->dev); in addrconf_sysctl_addr_gen_mode()
6407 idev = __in6_dev_get(dev); in addrconf_sysctl_addr_gen_mode()
6408 if (idev && in addrconf_sysctl_addr_gen_mode()
6409 idev->cnf.addr_gen_mode != new_val) { in addrconf_sysctl_addr_gen_mode()
6410 idev->cnf.addr_gen_mode = new_val; in addrconf_sysctl_addr_gen_mode()
6411 addrconf_dev_config(idev->dev); in addrconf_sysctl_addr_gen_mode()
6472 struct inet6_dev *idev = __in6_dev_get(dev); in addrconf_sysctl_stable_secret() local
6474 if (idev) { in addrconf_sysctl_stable_secret()
6475 idev->cnf.addr_gen_mode = in addrconf_sysctl_stable_secret()
6480 struct inet6_dev *idev = ctl->extra1; in addrconf_sysctl_stable_secret() local
6482 idev->cnf.addr_gen_mode = IN6_ADDR_GEN_MODE_STABLE_PRIVACY; in addrconf_sysctl_stable_secret()
6530 void addrconf_disable_policy_idev(struct inet6_dev *idev, int val) in addrconf_disable_policy_idev() argument
6534 read_lock_bh(&idev->lock); in addrconf_disable_policy_idev()
6535 list_for_each_entry(ifa, &idev->addr_list, if_list) { in addrconf_disable_policy_idev()
6556 read_unlock_bh(&idev->lock); in addrconf_disable_policy_idev()
6562 struct inet6_dev *idev; in addrconf_disable_policy() local
6580 idev = __in6_dev_get(dev); in addrconf_disable_policy()
6581 if (idev) in addrconf_disable_policy()
6582 addrconf_disable_policy_idev(idev, val); in addrconf_disable_policy()
6585 idev = (struct inet6_dev *)ctl->extra1; in addrconf_disable_policy()
6586 addrconf_disable_policy_idev(idev, val); in addrconf_disable_policy()
7059 struct inet6_dev *idev, struct ipv6_devconf *p) in __addrconf_sysctl_register() argument
7076 table[i].extra1 = idev; /* embedded; no ref */ in __addrconf_sysctl_register()
7092 ifindex = idev->dev->ifindex; in __addrconf_sysctl_register()
7119 static int addrconf_sysctl_register(struct inet6_dev *idev) in addrconf_sysctl_register() argument
7123 if (!sysctl_dev_name_is_allowed(idev->dev->name)) in addrconf_sysctl_register()
7126 err = neigh_sysctl_register(idev->dev, idev->nd_parms, in addrconf_sysctl_register()
7130 err = __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name, in addrconf_sysctl_register()
7131 idev, &idev->cnf); in addrconf_sysctl_register()
7133 neigh_sysctl_unregister(idev->nd_parms); in addrconf_sysctl_register()
7138 static void addrconf_sysctl_unregister(struct inet6_dev *idev) in addrconf_sysctl_unregister() argument
7140 __addrconf_sysctl_unregister(dev_net(idev->dev), &idev->cnf, in addrconf_sysctl_unregister()
7141 idev->dev->ifindex); in addrconf_sysctl_unregister()
7142 neigh_sysctl_unregister(idev->nd_parms); in addrconf_sysctl_unregister()
7273 struct inet6_dev *idev; in addrconf_init() local
7294 idev = ipv6_add_dev(blackhole_netdev); in addrconf_init()
7296 if (IS_ERR(idev)) { in addrconf_init()
7297 err = PTR_ERR(idev); in addrconf_init()