Lines Matching +defs:dev +defs:all
141 static int ipv6_generate_eui64(u8 *eui, struct net_device *dev);
158 static void addrconf_type_change(struct net_device *dev,
160 static int addrconf_ifdown(struct net_device *dev, bool unregister);
164 const struct net_device *dev,
311 static inline bool addrconf_link_ready(const struct net_device *dev)
313 return netif_oper_up(dev) && !qdisc_tx_is_noop(dev);
377 static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
383 netdev_ops_assert_locked(dev);
385 if (dev->mtu < IPV6_MIN_MTU && dev != blackhole_netdev)
393 ndev->dev = dev;
396 memcpy(&ndev->cnf, dev_net(dev)->ipv6.devconf_dflt, sizeof(ndev->cnf));
401 ndev->cnf.mtu6 = dev->mtu;
403 ndev->nd_parms = neigh_parms_alloc(dev, &nd_tbl);
409 netif_disable_lro(dev);
411 netdev_hold(dev, &ndev->dev_tracker, GFP_KERNEL);
414 netdev_dbg(dev, "%s: cannot allocate memory for statistics\n",
417 netdev_put(dev, &ndev->dev_tracker);
422 if (dev != blackhole_netdev) {
424 netdev_dbg(dev, "%s: cannot create /proc/net/dev_snmp6/%s\n",
425 __func__, dev->name);
432 if (dev->flags & (IFF_NOARP | IFF_LOOPBACK))
436 if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) {
437 pr_info("%s: Disabled Multicast RS\n", dev->name);
444 if ((dev->flags&IFF_LOOPBACK) ||
445 dev->type == ARPHRD_TUNNEL ||
446 dev->type == ARPHRD_TUNNEL6 ||
447 dev->type == ARPHRD_SIT ||
448 dev->type == ARPHRD_NONE) {
454 if (netif_running(dev) && addrconf_link_ready(dev))
459 if (dev != blackhole_netdev) {
468 rcu_assign_pointer(dev->ip6_ptr, ndev);
470 if (dev != blackhole_netdev) {
471 /* Join interface-local all-node multicast group */
472 ipv6_dev_mc_inc(dev, &in6addr_interfacelocal_allnodes);
474 /* Join all-node multicast group */
475 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
477 /* Join all-router multicast group if forwarding is set */
478 if (ndev->cnf.forwarding && (dev->flags & IFF_MULTICAST))
479 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
490 static struct inet6_dev *ipv6_find_idev(struct net_device *dev)
496 idev = __in6_dev_get(dev);
498 idev = ipv6_add_dev(dev);
503 if (dev->flags&IFF_UP)
512 bool all = false;
515 all = true;
517 if (all || type == NETCONFA_FORWARDING)
520 if (all || type == NETCONFA_MC_FORWARDING)
523 if (all || type == NETCONFA_PROXY_NEIGH)
526 if (all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN)
539 bool all = false;
547 all = true;
558 if ((all || type == NETCONFA_FORWARDING) &&
563 if ((all || type == NETCONFA_MC_FORWARDING) &&
568 if ((all || type == NETCONFA_PROXY_NEIGH) &&
573 if ((all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) &&
664 struct net_device *dev = NULL;
687 dev = dev_get_by_index(net, ifindex);
688 if (!dev)
690 in6_dev = in6_dev_get(dev);
716 dev_put(dev);
744 struct net_device *dev;
764 for_each_netdev_dump(net, dev, ctx->ifindex) {
765 idev = __in6_dev_get(dev);
768 err = inet6_netconf_fill_devconf(skb, dev->ifindex,
808 struct net_device *dev;
814 dev = idev->dev;
816 dev_disable_lro(dev);
817 if (dev->flags & IFF_MULTICAST) {
819 ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
820 ipv6_dev_mc_inc(dev, &in6addr_interfacelocal_allrouters);
821 ipv6_dev_mc_inc(dev, &in6addr_sitelocal_allrouters);
823 ipv6_dev_mc_dec(dev, &in6addr_linklocal_allrouters);
824 ipv6_dev_mc_dec(dev, &in6addr_interfacelocal_allrouters);
825 ipv6_dev_mc_dec(dev, &in6addr_sitelocal_allrouters);
847 inet6_netconf_notify_devconf(dev_net(dev), RTM_NEWNETCONF,
849 dev->ifindex, &idev->cnf);
855 struct net_device *dev;
858 for_each_netdev(net, dev) {
859 idev = __in6_dev_get_rtnl_net(dev);
862 /* Disabling all.forwarding sets 0 to force_forwarding for all interfaces */
921 struct net_device *dev;
924 for_each_netdev(net, dev) {
925 idev = __in6_dev_get_rtnl_net(dev);
931 inet6_netconf_notify_devconf(dev_net(dev),
934 dev->ifindex,
1031 struct net_device *dev, unsigned int hash)
1037 if (!dev || ifp->idev->dev == dev)
1044 static int ipv6_add_addr_hash(struct net_device *dev, struct inet6_ifaddr *ifa)
1046 struct net *net = dev_net(dev);
1053 if (ipv6_chk_same_addr(net, &ifa->addr, dev, hash)) {
1054 netdev_dbg(dev, "ipv6_add_addr: already assigned\n");
1073 struct net *net = dev_net(idev->dev);
1085 } else if (!(idev->dev->flags & IFF_LOOPBACK) &&
1086 !netif_is_l3_master(idev->dev) &&
1165 err = ipv6_add_addr_hash(idev->dev, ifa);
1273 ifp->idev->dev, 0, RTF_DEFAULT, true);
1276 ip6_del_rt(dev_net(ifp->idev->dev), f6i, false);
1298 struct net *net = dev_net(ifp->idev->dev);
1633 * d - C - 1 < B -15 (for all -1 <= d <= 15).
1667 dst->ifindex == score->ifa->idev->dev->ifindex);
1673 score->ifa->idev->dev->ifindex) == dst->label;
1749 idev->dev->name);
1820 struct net_device *dev;
1887 for_each_netdev_rcu(net, dev) {
1891 if (l3mdev_master_ifindex_rcu(dev) != master_idx)
1893 idev = __in6_dev_get(dev);
1931 int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
1938 idev = __in6_dev_get(dev);
1961 const struct net_device *dev, int strict)
1963 return ipv6_chk_addr_and_flags(net, addr, dev, !dev,
1970 * the passed in dev argument. So the 2 cases for addresses checks are:
1971 * 1. does the address exist in the L3 domain that dev is part of
1979 const struct net_device *dev, bool skip_dev_check,
1989 l3mdev = l3mdev_master_dev_rcu(dev);
1991 dev = NULL;
1994 ndev = ifp->idev->dev;
2007 (!dev || ndev == dev ||
2019 const struct net_device *dev, bool skip_dev_check,
2022 return __ipv6_chk_addr_and_flags(net, addr, dev, skip_dev_check,
2028 /* Compares an address/prefix_len with addresses on device @dev.
2032 const unsigned int prefix_len, struct net_device *dev)
2039 idev = __in6_dev_get(dev);
2053 int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev)
2061 idev = __in6_dev_get(dev);
2079 * @dev: used to find the L3 domain of interest
2084 struct net_device *dev)
2086 return __ipv6_chk_addr_and_flags(net, addr, dev, !dev, 1,
2092 struct net_device *dev, int strict)
2100 if (!dev || ifp->idev->dev == dev ||
2166 struct net *net = dev_net(idev->dev);
2175 ifp->idev->dev->name, &ifp->addr, eth_hdr(skb)->h_source);
2194 ifp->idev->dev->name);
2211 ifp->idev->dev->name);
2238 void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr)
2242 if (READ_ONCE(dev->flags) & (IFF_LOOPBACK | IFF_NOARP))
2246 ipv6_dev_mc_inc(dev, &maddr);
2253 if (READ_ONCE(idev->dev->flags) & (IFF_LOOPBACK | IFF_NOARP))
2284 static int addrconf_ifid_6lowpan(u8 *eui, struct net_device *dev)
2286 switch (dev->addr_len) {
2288 memcpy(eui, dev->dev_addr, 3);
2291 memcpy(eui + 5, dev->dev_addr + 3, 3);
2294 memcpy(eui, dev->dev_addr, EUI64_ADDR_LEN);
2304 static int addrconf_ifid_ieee1394(u8 *eui, struct net_device *dev)
2308 if (dev->addr_len != FWNET_ALEN)
2311 ha = (const union fwnet_hwaddr *)dev->dev_addr;
2318 static int addrconf_ifid_arcnet(u8 *eui, struct net_device *dev)
2321 if (dev->addr_len != ARCNET_ALEN)
2324 eui[7] = *(u8 *)dev->dev_addr;
2328 static int addrconf_ifid_infiniband(u8 *eui, struct net_device *dev)
2330 if (dev->addr_len != INFINIBAND_ALEN)
2332 memcpy(eui, dev->dev_addr + 12, 8);
2354 static int addrconf_ifid_sit(u8 *eui, struct net_device *dev)
2356 if (dev->priv_flags & IFF_ISATAP)
2357 return __ipv6_isatap_ifid(eui, *(__be32 *)dev->dev_addr);
2361 static int addrconf_ifid_gre(u8 *eui, struct net_device *dev)
2363 return __ipv6_isatap_ifid(eui, *(__be32 *)dev->dev_addr);
2366 static int addrconf_ifid_ip6tnl(u8 *eui, struct net_device *dev)
2368 memcpy(eui, dev->perm_addr, 3);
2369 memcpy(eui + 5, dev->perm_addr + 3, 3);
2376 static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
2378 switch (dev->type) {
2381 return addrconf_ifid_eui48(eui, dev);
2383 return addrconf_ifid_arcnet(eui, dev);
2385 return addrconf_ifid_infiniband(eui, dev);
2387 return addrconf_ifid_sit(eui, dev);
2390 return addrconf_ifid_gre(eui, dev);
2392 return addrconf_ifid_6lowpan(eui, dev);
2394 return addrconf_ifid_ieee1394(eui, dev);
2398 return addrconf_ifid_ip6tnl(eui, dev);
2462 struct net_device *dev, unsigned long expires,
2466 .fc_table = l3mdev_fib_table(dev) ? : RT6_TABLE_PREFIX,
2468 .fc_ifindex = dev->ifindex,
2472 .fc_nlinfo.nl_net = dev_net(dev),
2484 if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT))
2494 const struct net_device *dev,
2501 u32 tb_id = l3mdev_fib_table(dev) ? : RT6_TABLE_PREFIX;
2503 table = fib6_get_table(dev_net(dev), tb_id);
2517 if (rt->fib6_nh->fib_nh_dev->ifindex != dev->ifindex)
2537 static void addrconf_add_mroute(struct net_device *dev)
2540 .fc_table = l3mdev_fib_table(dev) ? : RT6_TABLE_LOCAL,
2542 .fc_ifindex = dev->ifindex,
2546 .fc_nlinfo.nl_net = dev_net(dev),
2555 static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
2561 idev = ipv6_find_idev(dev);
2569 if (!(dev->flags & IFF_LOOPBACK) && !netif_is_l3_master(dev))
2570 addrconf_add_mroute(dev);
2602 /* update all temporary addresses in the list */
2672 int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
2679 struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1);
2775 void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
2784 struct net *net = dev_net(dev);
2790 netdev_dbg(dev, "addrconf: prefix option too short\n");
2811 in6_dev = in6_dev_get(dev);
2815 dev->name);
2847 dev,
2880 0, dev, expires, flags,
2907 } else if (ipv6_generate_eui64(addr.s6_addr + 8, dev) &&
2920 err = addrconf_prefix_rcv_add_addr(net, dev, pinfo, in6_dev,
2931 ndisc_ops_prefix_rcv_add_addr(net, dev, pinfo, in6_dev, &addr,
2942 static int addrconf_set_sit_dstaddr(struct net *net, struct net_device *dev,
2957 if (!dev->netdev_ops->ndo_tunnel_ctl)
2959 err = dev->netdev_ops->ndo_tunnel_ctl(dev, &p, SIOCADDTUNNEL);
2963 dev = __dev_get_by_name(net, p.name);
2964 if (!dev)
2966 return dev_open(dev, NULL);
2976 struct net_device *dev;
2986 dev = __dev_get_by_index(net, ireq.ifr6_ifindex);
2987 if (dev && dev->type == ARPHRD_SIT)
2988 err = addrconf_set_sit_dstaddr(net, dev, &ireq);
3013 static int inet6_addr_add(struct net *net, struct net_device *dev,
3032 idev = addrconf_add_dev(dev);
3040 true, cfg->pfx, dev->ifindex);
3054 ifp->rt_priority, dev, expires,
3077 cfg->pfx, dev->ifindex);
3089 struct net_device *dev;
3096 dev = __dev_get_by_index(net, ifindex);
3097 if (!dev) {
3102 idev = __in6_dev_get_rtnl_net(dev);
3124 false, pfx, dev->ifindex);
3143 struct net_device *dev;
3157 dev = __dev_get_by_index(net, ireq.ifr6_ifindex);
3158 if (dev) {
3159 netdev_lock_ops(dev);
3160 err = inet6_addr_add(net, dev, &cfg, 0, 0, NULL);
3161 netdev_unlock_ops(dev);
3206 rt_genid_bump_ipv6(dev_net(idev->dev));
3216 struct net_device *dev;
3217 struct net *net = dev_net(idev->dev);
3224 memcpy(&addr.s6_addr32[3], idev->dev->dev_addr, 4);
3226 if (!(idev->dev->flags & IFF_POINTOPOINT) && idev->dev->type == ARPHRD_SIT) {
3241 addrconf_prefix_route(&addr, plen, 0, idev->dev, 0, pflags,
3246 for_each_netdev(net, dev) {
3247 struct in_device *in_dev = __in_dev_get_rtnl(dev);
3248 if (in_dev && (dev->flags & IFF_UP)) {
3258 if (idev->dev->flags&IFF_POINTOPOINT)
3265 addrconf_prefix_route(&addr, plen, 0, idev->dev,
3273 static void init_loopback(struct net_device *dev)
3281 idev = ipv6_find_idev(dev);
3305 if ((READ_ONCE(dev_net(idev->dev)->ipv6.devconf_all->optimistic_dad) ||
3307 !dev_net(idev->dev)->ipv6.devconf_all->forwarding)
3313 addrconf_prefix_route(&ifp->addr, ifp->prefix_len, 0, idev->dev,
3357 struct net *net = dev_net(idev->dev);
3374 memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len);
3390 if (dad_count > dev_net(idev->dev)->ipv6.sysctl.idgen_retries)
3415 if (netif_is_l3_master(idev->dev))
3419 if (idev->dev->priv_flags & IFF_NO_ADDRCONF)
3433 addrconf_prefix_route(&addr, 64, 0, idev->dev,
3441 if (ipv6_generate_eui64(addr.s6_addr + 8, idev->dev) == 0)
3444 addrconf_prefix_route(&addr, 64, 0, idev->dev,
3454 static void addrconf_dev_config(struct net_device *dev)
3460 if ((dev->type != ARPHRD_ETHER) &&
3461 (dev->type != ARPHRD_FDDI) &&
3462 (dev->type != ARPHRD_ARCNET) &&
3463 (dev->type != ARPHRD_INFINIBAND) &&
3464 (dev->type != ARPHRD_IEEE1394) &&
3465 (dev->type != ARPHRD_TUNNEL6) &&
3466 (dev->type != ARPHRD_6LOWPAN) &&
3467 (dev->type != ARPHRD_IP6GRE) &&
3468 (dev->type != ARPHRD_TUNNEL) &&
3469 (dev->type != ARPHRD_NONE) &&
3470 (dev->type != ARPHRD_RAWIP)) {
3472 idev = __in6_dev_get(dev);
3473 if (!IS_ERR_OR_NULL(idev) && dev->flags & IFF_UP &&
3474 dev->flags & IFF_MULTICAST)
3479 idev = addrconf_add_dev(dev);
3484 if (dev->type == ARPHRD_NONE &&
3493 static void addrconf_sit_config(struct net_device *dev)
3501 * addresses... we should configure all of
3505 idev = ipv6_find_idev(dev);
3511 if (dev->priv_flags & IFF_ISATAP) {
3518 if (dev->flags&IFF_POINTOPOINT)
3519 addrconf_add_mroute(dev);
3524 static void addrconf_gre_config(struct net_device *dev)
3530 idev = addrconf_add_dev(dev);
3539 if (!(*(__be32 *)dev->dev_addr == 0 &&
3549 static void addrconf_init_auto_addrs(struct net_device *dev)
3551 switch (dev->type) {
3554 addrconf_sit_config(dev);
3559 addrconf_gre_config(dev);
3563 init_loopback(dev);
3567 addrconf_dev_config(dev);
3599 ifp->rt_priority, idev->dev, 0, 0,
3609 static void addrconf_permanent_addr(struct net *net, struct net_device *dev)
3614 idev = __in6_dev_get(dev);
3629 idev->dev->name, &ifp->addr);
3639 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
3642 struct inet6_dev *idev = __in6_dev_get(dev);
3643 struct net *net = dev_net(dev);
3649 if (!idev && dev->mtu >= IPV6_MIN_MTU) {
3650 idev = ipv6_add_dev(dev);
3658 if (dev->mtu < IPV6_MIN_MTU) {
3659 addrconf_ifdown(dev, dev != net->loopback_dev);
3664 rt6_mtu_change(dev, dev->mtu);
3665 WRITE_ONCE(idev->cnf.mtu6, dev->mtu);
3670 idev = ipv6_add_dev(dev);
3685 if (dev->priv_flags & IFF_NO_ADDRCONF) {
3687 dev->flags & IFF_UP && dev->flags & IFF_MULTICAST)
3694 addrconf_permanent_addr(net, dev);
3696 if (!addrconf_link_ready(dev)) {
3699 dev->name);
3703 if (!idev && dev->mtu >= IPV6_MIN_MTU)
3704 idev = ipv6_add_dev(dev);
3711 if (!addrconf_link_ready(dev)) {
3713 rt6_sync_down_dev(dev, event);
3728 rt6_sync_up(dev, RTNH_F_LINKDOWN);
3735 dev->name);
3740 addrconf_init_auto_addrs(dev);
3747 rt6_sync_up(dev, RTNH_F_DEAD);
3754 if (idev->cnf.mtu6 != dev->mtu &&
3755 dev->mtu >= IPV6_MIN_MTU) {
3756 rt6_mtu_change(dev, dev->mtu);
3757 WRITE_ONCE(idev->cnf.mtu6, dev->mtu);
3766 if (dev->mtu < IPV6_MIN_MTU)
3767 addrconf_ifdown(dev, dev != net->loopback_dev);
3774 * Remove all addresses from this interface.
3776 addrconf_ifdown(dev, event != NETDEV_DOWN);
3797 addrconf_type_change(dev, event);
3803 /* flush all routes if dev is linked to or unlinked from
3807 addrconf_ifdown(dev, false);
3821 static void addrconf_type_change(struct net_device *dev, unsigned long event)
3826 idev = __in6_dev_get(dev);
3840 static int addrconf_ifdown(struct net_device *dev, bool unregister)
3843 struct net *net = dev_net(dev);
3853 rt6_disable_ip(dev, event);
3855 idev = __in6_dev_get(dev);
3867 RCU_INIT_POINTER(dev->ip6_ptr, NULL);
4008 neigh_ifdown(&nd_tbl, dev);
4017 struct net_device *dev = idev->dev;
4036 if (!ipv6_get_lladdr(dev, &lladdr, IFA_F_TENTATIVE))
4037 ndisc_send_rs(dev, &lladdr,
4053 * Note: we do not support deprecated "all on-link"
4056 pr_debug("%s: no IPv6 routers present\n", idev->dev->name);
4082 READ_ONCE(dev_net(idev->dev)->ipv6.devconf_all->enhanced_dad)) {
4095 struct net_device *dev = idev->dev;
4099 addrconf_join_solict(dev, &ifp->addr);
4106 net = dev_net(dev);
4107 if (dev->flags&(IFF_NOARP|IFF_LOOPBACK) ||
4192 net = dev_net(idev->dev);
4213 if (!ipv6_generate_eui64(addr.s6_addr + 8, idev->dev) &&
4219 ifp->idev->dev->name);
4233 addrconf_ifdown(idev->dev, false);
4282 ndisc_send_ns(ifp->idev->dev, &ifp->addr, &mcaddr, &in6addr_any,
4310 struct net_device *dev = ifp->idev->dev;
4331 (dev->flags & IFF_LOOPBACK) == 0 &&
4332 (dev->type != ARPHRD_TUNNEL) &&
4333 !netif_is_team_port(dev);
4345 READ_ONCE(dev_net(dev)->ipv6.devconf_all->ndisc_notify))) {
4346 ndisc_send_na(dev, &in6addr_linklocal_allnodes, &ifp->addr,
4358 if (ipv6_get_lladdr(dev, &lladdr, IFA_F_TENTATIVE))
4360 ndisc_send_rs(dev, &lladdr, &in6addr_linklocal_allrouters);
4374 rt_genid_bump_ipv6(dev_net(dev));
4380 addrconf_verify_rtnl(dev_net(dev));
4488 ifp->idev->dev->ifindex,
4492 ifp->idev->dev->name);
4817 ifp->idev->dev, 0, RTF_DEFAULT, true);
4824 ip6_del_rt(dev_net(ifp->idev->dev), f6i, false);
4829 ifp->rt_priority, ifp->idev->dev,
4908 ifp->rt_priority, ifp->idev->dev,
4917 ifp->rt_priority, ifp->idev->dev,
4956 struct net_device *dev;
5029 dev = __dev_get_by_index(net, ifm->ifa_index);
5030 if (!dev) {
5036 netdev_lock_ops(dev);
5037 idev = ipv6_find_idev(dev);
5053 ifa = ipv6_get_ifaddr(net, cfg.pfx, dev, 1);
5059 err = inet6_addr_add(net, dev, &cfg, expires, flags, extack);
5073 netdev_unlock_ops(dev);
5145 ifa->idev->dev->ifindex);
5211 int ifindex = ifmca->idev->dev->ifindex;
5246 struct net_device *dev = fib6_info_nh_dev(ifaca->aca_rt);
5247 int ifindex = dev ? dev->ifindex : 1;
5411 struct net_device *dev;
5424 dev = dev_get_by_index_rcu(tgt_net, fillargs.ifindex);
5425 if (!dev) {
5429 idev = __in6_dev_get(dev);
5439 for_each_netdev_dump(tgt_net, dev, ctx->ifindex) {
5440 idev = __in6_dev_get(dev);
5539 struct net_device *dev = NULL;
5564 dev = dev_get_by_index(tgt_net, ifm->ifa_index);
5566 ifa = ipv6_get_ifaddr(tgt_net, addr, dev, 1);
5589 dev_put(dev);
5599 struct net *net = dev_net(ifa->idev->dev);
5864 static size_t inet6_get_link_af_size(const struct net_device *dev,
5867 if (!__in6_dev_get(dev))
5873 static int inet6_fill_link_af(struct sk_buff *skb, const struct net_device *dev,
5876 struct inet6_dev *idev = __in6_dev_get(dev);
5891 struct net_device *dev = idev->dev;
5900 if (dev->flags & IFF_LOOPBACK) {
5905 if (dev->flags & IFF_NOARP) {
5935 !ipv6_get_lladdr(dev, &ll_addr, IFA_F_TENTATIVE |
5940 ndisc_send_rs(dev, &ll_addr, &in6addr_linklocal_allrouters);
5967 addrconf_verify_rtnl(dev_net(dev));
5999 static int inet6_validate_link_af(const struct net_device *dev,
6007 if (dev) {
6008 idev = __in6_dev_get(dev);
6026 if (dev && check_stable_privacy(idev, dev_net(dev), mode) < 0)
6033 static int inet6_set_link_af(struct net_device *dev, const struct nlattr *nla,
6036 struct inet6_dev *idev = __in6_dev_get(dev);
6065 struct net_device *dev = idev->dev;
6078 hdr->ifi_type = dev->type;
6079 ifindex = READ_ONCE(dev->ifindex);
6081 hdr->ifi_flags = netif_get_flags(dev);
6084 iflink = dev_get_iflink(dev);
6085 if (nla_put_string(skb, IFLA_IFNAME, dev->name) ||
6086 (dev->addr_len &&
6087 nla_put(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr)) ||
6088 nla_put_u32(skb, IFLA_MTU, READ_ONCE(dev->mtu)) ||
6092 netif_running(dev) ? READ_ONCE(dev->operstate) : IF_OPER_DOWN))
6141 struct net_device *dev;
6157 for_each_netdev_dump(net, dev, ctx->ifindex) {
6158 idev = __in6_dev_get(dev);
6176 struct net *net = dev_net(idev->dev);
6219 pmsg->prefix_ifindex = idev->dev->ifindex;
6243 struct net *net = dev_net(idev->dev);
6265 struct net *net = dev_net(ifp->idev->dev);
6284 } else if (!ifp->rt && (ifp->idev->dev->flags & IFF_UP)) {
6286 &ifp->addr, ifp->idev->dev->name);
6293 ifp->rt_priority, ifp->idev->dev,
6304 ifp->idev->dev, 0, 0,
6361 lctl.extra2 = idev ? &idev->dev->mtu : NULL;
6370 if (!idev || !idev->dev)
6373 netdev_notifier_info_init(&info, idev->dev);
6382 struct net_device *dev;
6385 for_each_netdev(net, dev) {
6386 idev = __in6_dev_get_rtnl_net(dev);
6481 idev->dev->ifindex,
6527 netdev_lock_ops(idev->dev);
6528 addrconf_init_auto_addrs(idev->dev);
6529 netdev_unlock_ops(idev->dev);
6532 struct net_device *dev;
6535 for_each_netdev(net, dev) {
6536 idev = __in6_dev_get_rtnl_net(dev);
6541 netdev_lock_ops(idev->dev);
6542 addrconf_init_auto_addrs(idev->dev);
6543 netdev_unlock_ops(idev->dev);
6601 struct net_device *dev;
6603 for_each_netdev(net, dev) {
6604 struct inet6_dev *idev = __in6_dev_get_rtnl_net(dev);
6709 struct net_device *dev;
6711 for_each_netdev(net, dev) {
6712 idev = __in6_dev_get_rtnl_net(dev);
6749 struct net_device *dev;
6752 for_each_netdev(net, dev) {
6753 idev = __in6_dev_get_rtnl_net(dev);
6759 inet6_netconf_notify_devconf(dev_net(dev), RTM_NEWNETCONF,
6761 dev->ifindex, &idev->cnf);
6805 idev->dev->ifindex,
7328 if (!strcmp(dev_name, "all"))
7333 ifindex = idev->dev->ifindex;
7364 if (!sysctl_dev_name_is_allowed(idev->dev->name))
7367 err = neigh_sysctl_register(idev->dev, idev->nd_parms,
7371 err = __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name,
7381 __addrconf_sysctl_unregister(dev_net(idev->dev), &idev->cnf,
7382 idev->dev->ifindex);
7392 struct ipv6_devconf *all, *dflt;
7402 all = kmemdup(&ipv6_devconf, sizeof(ipv6_devconf), GFP_KERNEL);
7403 if (!all)
7413 memcpy(all, init_net.ipv6.devconf_all,
7419 memcpy(all, current->nsproxy->net_ns->ipv6.devconf_all,
7432 /* these will be inherited by all namespaces */
7437 all->stable_secret.initialized = false;
7439 net->ipv6.devconf_all = all;
7443 err = __addrconf_sysctl_register(net, "all", NULL, all);
7455 __addrconf_sysctl_unregister(net, all, NETCONFA_IFINDEX_ALL);
7461 kfree(all);
7600 struct net_device *dev;
7610 /* clean dev list */
7611 for_each_netdev(&init_net, dev) {
7612 if (!__in6_dev_get_rtnl_net(dev))
7614 addrconf_ifdown(dev, true);