Lines Matching +refs:dev +refs:all

174 		result = ifa->ifa_dev->dev;  in __ip_dev_find()
191 net_eq(dev_net(ifa->ifa_dev->dev), net)) in inet_lookup_ifaddr_rcu()
262 struct net_device *dev = idev->dev; in in_dev_finish_destroy() local
267 pr_debug("%s: %p=%s\n", __func__, idev, dev ? dev->name : "NIL"); in in_dev_finish_destroy()
269 netdev_put(dev, &idev->dev_tracker); in in_dev_finish_destroy()
277 static struct in_device *inetdev_init(struct net_device *dev) in inetdev_init() argument
287 memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, in inetdev_init()
290 in_dev->dev = dev; in inetdev_init()
291 in_dev->arp_parms = neigh_parms_alloc(dev, &arp_tbl); in inetdev_init()
295 dev_disable_lro(dev); in inetdev_init()
297 netdev_hold(dev, &in_dev->dev_tracker, GFP_KERNEL); in inetdev_init()
301 if (dev != blackhole_netdev) { in inetdev_init()
311 if (dev->flags & IFF_UP) in inetdev_init()
316 rcu_assign_pointer(dev->ip_ptr, in_dev); in inetdev_init()
327 struct net_device *dev; in inetdev_destroy() local
332 dev = in_dev->dev; in inetdev_destroy()
343 RCU_INIT_POINTER(dev->ip_ptr, NULL); in inetdev_destroy()
347 arp_ifdown(dev); in inetdev_destroy()
577 inet_hash_insert(dev_net(in_dev->dev), ifa); in __inet_insert_ifa()
596 static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa) in inet_set_ifa() argument
598 struct in_device *in_dev = __in_dev_get_rtnl(dev); in inet_set_ifa()
615 struct net_device *dev; in inetdev_by_index() local
619 dev = dev_get_by_index_rcu(net, ifindex); in inetdev_by_index()
620 if (dev) in inetdev_by_index()
621 in_dev = rcu_dereference_rtnl(dev->ip_ptr); in inetdev_by_index()
649 .imr_ifindex = ifa->ifa_dev->dev->ifindex, in ip_mc_autojoin_config()
859 struct net_device *dev; in rtm_to_ifaddr() local
881 dev = __dev_get_by_index(net, ifm->ifa_index); in rtm_to_ifaddr()
883 if (!dev) { in rtm_to_ifaddr()
888 in_dev = __in_dev_get_rtnl(dev); in rtm_to_ifaddr()
921 memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); in rtm_to_ifaddr()
1061 struct net_device *dev; in devinet_ioctl() local
1115 dev = __dev_get_by_name(net, ifr->ifr_name); in devinet_ioctl()
1116 if (!dev) in devinet_ioctl()
1122 in_dev = __in_dev_get_rtnl(dev); in devinet_ioctl()
1188 ret = dev_change_flags(dev, ifr->ifr_flags, NULL); in devinet_ioctl()
1207 memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); in devinet_ioctl()
1219 if (!(dev->flags & IFF_POINTOPOINT)) { in devinet_ioctl()
1222 if ((dev->flags & IFF_BROADCAST) && in devinet_ioctl()
1231 ret = inet_set_ifa(dev, ifa); in devinet_ioctl()
1277 if ((dev->flags & IFF_BROADCAST) && in devinet_ioctl()
1294 int inet_gifconf(struct net_device *dev, char __user *buf, int len, int size) in inet_gifconf() argument
1296 struct in_device *in_dev = __in_dev_get_rtnl(dev); in inet_gifconf()
1348 __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope) in inet_select_addr() argument
1354 struct net *net = dev_net(dev); in inet_select_addr()
1358 in_dev = __in_dev_get_rcu(dev); in inet_select_addr()
1381 master_idx = l3mdev_master_ifindex_rcu(dev); in inet_select_addr()
1389 (dev = dev_get_by_index_rcu(net, master_idx)) && in inet_select_addr()
1390 (in_dev = __in_dev_get_rcu(dev))) { in inet_select_addr()
1400 for_each_netdev_rcu(net, dev) { in inet_select_addr()
1401 if (l3mdev_master_ifindex_rcu(dev) != master_idx) in inet_select_addr()
1404 in_dev = __in_dev_get_rcu(dev); in inet_select_addr()
1474 struct net_device *dev; in inet_confirm_addr() local
1480 for_each_netdev_rcu(net, dev) { in inet_confirm_addr()
1481 in_dev = __in_dev_get_rcu(dev); in inet_confirm_addr()
1526 static void inetdev_changename(struct net_device *dev, struct in_device *in_dev) in inetdev_changename() argument
1535 memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); in inetdev_changename()
1543 if (strlen(dot) + strlen(dev->name) < IFNAMSIZ) in inetdev_changename()
1552 static void inetdev_send_gratuitous_arp(struct net_device *dev, in inetdev_send_gratuitous_arp() argument
1560 ifa->ifa_local, dev, in inetdev_send_gratuitous_arp()
1562 dev->dev_addr, NULL); in inetdev_send_gratuitous_arp()
1571 struct net_device *dev = netdev_notifier_info_to_dev(ptr); in inetdev_event() local
1572 struct in_device *in_dev = __in_dev_get_rtnl(dev); in inetdev_event()
1578 in_dev = inetdev_init(dev); in inetdev_event()
1581 if (dev->flags & IFF_LOOPBACK) { in inetdev_event()
1587 if (inetdev_valid_mtu(dev->mtu)) in inetdev_event()
1588 in_dev = inetdev_init(dev); in inetdev_event()
1596 RCU_INIT_POINTER(dev->ip_ptr, NULL); in inetdev_event()
1599 if (!inetdev_valid_mtu(dev->mtu)) in inetdev_event()
1601 if (dev->flags & IFF_LOOPBACK) { in inetdev_event()
1610 memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); in inetdev_event()
1626 inetdev_send_gratuitous_arp(dev, in_dev); in inetdev_event()
1638 if (inetdev_valid_mtu(dev->mtu)) in inetdev_event()
1649 inetdev_changename(dev, in_dev); in inetdev_event()
1719 ifm->ifa_index = ifa->ifa_dev->dev->ifindex; in inet_fill_ifaddr()
1889 struct net_device *dev; in inet_dump_ifaddr() local
1900 dev = dev_get_by_index_rcu(tgt_net, fillargs.ifindex); in inet_dump_ifaddr()
1901 if (!dev) { in inet_dump_ifaddr()
1905 in_dev = __in_dev_get_rcu(dev); in inet_dump_ifaddr()
1916 for_each_netdev_dump(tgt_net, dev, ctx->ifindex) { in inet_dump_ifaddr()
1917 in_dev = __in_dev_get_rcu(dev); in inet_dump_ifaddr()
1946 net = dev_net(ifa->ifa_dev->dev); in rtmsg_ifa()
1964 static size_t inet_get_link_af_size(const struct net_device *dev, in inet_get_link_af_size() argument
1967 struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); in inet_get_link_af_size()
1975 static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev, in inet_fill_link_af() argument
1978 struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); in inet_fill_link_af()
1999 static int inet_validate_link_af(const struct net_device *dev, in inet_validate_link_af() argument
2006 if (dev && !__in_dev_get_rtnl(dev)) in inet_validate_link_af()
2029 static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla, in inet_set_link_af() argument
2032 struct in_device *in_dev = __in_dev_get_rtnl(dev); in inet_set_link_af()
2054 bool all = false; in inet_netconf_msgsize_devconf() local
2057 all = true; in inet_netconf_msgsize_devconf()
2059 if (all || type == NETCONFA_FORWARDING) in inet_netconf_msgsize_devconf()
2061 if (all || type == NETCONFA_RP_FILTER) in inet_netconf_msgsize_devconf()
2063 if (all || type == NETCONFA_MC_FORWARDING) in inet_netconf_msgsize_devconf()
2065 if (all || type == NETCONFA_BC_FORWARDING) in inet_netconf_msgsize_devconf()
2067 if (all || type == NETCONFA_PROXY_NEIGH) in inet_netconf_msgsize_devconf()
2069 if (all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) in inet_netconf_msgsize_devconf()
2082 bool all = false; in inet_netconf_fill_devconf() local
2090 all = true; in inet_netconf_fill_devconf()
2101 if ((all || type == NETCONFA_FORWARDING) && in inet_netconf_fill_devconf()
2105 if ((all || type == NETCONFA_RP_FILTER) && in inet_netconf_fill_devconf()
2109 if ((all || type == NETCONFA_MC_FORWARDING) && in inet_netconf_fill_devconf()
2113 if ((all || type == NETCONFA_BC_FORWARDING) && in inet_netconf_fill_devconf()
2117 if ((all || type == NETCONFA_PROXY_NEIGH) && in inet_netconf_fill_devconf()
2121 if ((all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) && in inet_netconf_fill_devconf()
2215 struct net_device *dev = NULL; in inet_netconf_get_devconf() local
2237 dev = dev_get_by_index(net, ifindex); in inet_netconf_get_devconf()
2238 if (dev) in inet_netconf_get_devconf()
2239 in_dev = in_dev_get(dev); in inet_netconf_get_devconf()
2265 dev_put(dev); in inet_netconf_get_devconf()
2279 struct net_device *dev; in inet_netconf_dump_devconf() local
2298 for_each_netdev_dump(net, dev, ctx->ifindex) { in inet_netconf_dump_devconf()
2299 in_dev = __in_dev_get_rcu(dev); in inet_netconf_dump_devconf()
2302 err = inet_netconf_fill_devconf(skb, dev->ifindex, in inet_netconf_dump_devconf()
2342 struct net_device *dev; in devinet_copy_dflt_conf() local
2345 for_each_netdev_rcu(net, dev) { in devinet_copy_dflt_conf()
2348 in_dev = __in_dev_get_rcu(dev); in devinet_copy_dflt_conf()
2358 struct net_device *dev; in inet_forward_change() local
2372 for_each_netdev(net, dev) { in inet_forward_change()
2376 dev_disable_lro(dev); in inet_forward_change()
2378 in_dev = __in_dev_get_rtnl(dev); in inet_forward_change()
2383 dev->ifindex, &in_dev->cnf); in inet_forward_change()
2397 return idev->dev->ifindex; in devinet_conf_ifindex()
2482 dev_disable_lro(idev->dev); in devinet_sysctl_forward()
2485 idev->dev->ifindex, in devinet_sysctl_forward()
2644 if (!sysctl_dev_name_is_allowed(idev->dev->name)) in devinet_sysctl_register()
2647 err = neigh_sysctl_register(idev->dev, idev->arp_parms, NULL); in devinet_sysctl_register()
2650 err = __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, in devinet_sysctl_register()
2651 idev->dev->ifindex, &idev->cnf); in devinet_sysctl_register()
2659 struct net *net = dev_net(idev->dev); in devinet_sysctl_unregister()
2661 __devinet_sysctl_unregister(net, &idev->cnf, idev->dev->ifindex); in devinet_sysctl_unregister()
2682 struct ipv4_devconf *all, *dflt; in devinet_init_net() local
2689 all = kmemdup(&ipv4_devconf, sizeof(ipv4_devconf), GFP_KERNEL); in devinet_init_net()
2690 if (!all) in devinet_init_net()
2702 tbl[0].data = &all->data[IPV4_DEVCONF_FORWARDING - 1]; in devinet_init_net()
2703 tbl[0].extra1 = all; in devinet_init_net()
2711 memcpy(all, current->nsproxy->net_ns->ipv4.devconf_all, in devinet_init_net()
2720 memcpy(all, init_net.ipv4.devconf_all, in devinet_init_net()
2732 err = __devinet_sysctl_register(net, "all", NETCONFA_IFINDEX_ALL, all); in devinet_init_net()
2749 net->ipv4.devconf_all = all; in devinet_init_net()
2757 __devinet_sysctl_unregister(net, all, NETCONFA_IFINDEX_ALL); in devinet_init_net()
2764 kfree(all); in devinet_init_net()