[NET]: Make the device list and device lookups per namespace.
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 17 Sep 2007 18:56:21 +0000 (11:56 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:49:10 +0000 (16:49 -0700)
commit881d966b48b035ab3f3aeaae0f3d3f9b584f45b2
treec579d59a4107cbbe9e2b85939bc0d496b815c887
parentb4b510290b056b86611757ce1175a230f1080f53
[NET]: Make the device list and device lookups per namespace.

This patch makes most of the generic device layer network
namespace safe.  This patch makes dev_base_head a
network namespace variable, and then it picks up
a few associated variables.  The functions:
dev_getbyhwaddr
dev_getfirsthwbytype
dev_get_by_flags
dev_get_by_name
__dev_get_by_name
dev_get_by_index
__dev_get_by_index
dev_ioctl
dev_ethtool
dev_load
wireless_process_ioctl

were modified to take a network namespace argument, and
deal with it.

vlan_ioctl_set and brioctl_set were modified so their
hooks will receive a network namespace argument.

So basically anthing in the core of the network stack that was
affected to by the change of dev_base was modified to handle
multiple network namespaces.  The rest of the network stack was
simply modified to explicitly use &init_net the initial network
namespace.  This can be fixed when those components of the network
stack are modified to handle multiple network namespaces.

For now the ifindex generator is left global.

Fundametally ifindex numbers are per namespace, or else
we will have corner case problems with migration when
we get that far.

At the same time there are assumptions in the network stack
that the ifindex of a network device won't change.  Making
the ifindex number global seems a good compromise until
the network stack can cope with ifindex changes when
you change namespaces, and the like.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
99 files changed:
arch/s390/appldata/appldata_net_sum.c
arch/sparc64/solaris/ioctl.c
drivers/atm/idt77252.c
drivers/block/aoe/aoecmd.c
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_sysfs.c
drivers/net/eql.c
drivers/net/ifb.c
drivers/net/macvlan.c
drivers/net/pppoe.c
drivers/net/shaper.c
drivers/net/tun.c
drivers/net/veth.c
drivers/net/wan/dlci.c
drivers/net/wan/sbni.c
drivers/net/wireless/strip.c
drivers/parisc/led.c
fs/afs/netdevices.c
include/linux/if_bridge.h
include/linux/if_vlan.h
include/linux/netdevice.h
include/net/net_namespace.h
include/net/pkt_cls.h
include/net/rtnetlink.h
include/net/wext.h
net/802/tr.c
net/8021q/vlan.c
net/8021q/vlan_netlink.c
net/8021q/vlanproc.c
net/appletalk/ddp.c
net/atm/mpc.c
net/ax25/af_ax25.c
net/bridge/br_if.c
net/bridge/br_ioctl.c
net/bridge/br_netlink.c
net/bridge/br_private.h
net/core/dev.c
net/core/dev_mcast.c
net/core/ethtool.c
net/core/fib_rules.c
net/core/neighbour.c
net/core/netpoll.c
net/core/pktgen.c
net/core/rtnetlink.c
net/core/sock.c
net/decnet/af_decnet.c
net/decnet/dn_dev.c
net/decnet/dn_fib.c
net/decnet/dn_route.c
net/decnet/sysctl_net_decnet.c
net/econet/af_econet.c
net/ipv4/arp.c
net/ipv4/devinet.c
net/ipv4/fib_frontend.c
net/ipv4/fib_semantics.c
net/ipv4/icmp.c
net/ipv4/igmp.c
net/ipv4/ip_fragment.c
net/ipv4/ip_gre.c
net/ipv4/ip_sockglue.c
net/ipv4/ipconfig.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv4/ipvs/ip_vs_sync.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/route.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/anycast.c
net/ipv6/datagram.c
net/ipv6/ip6_tunnel.c
net/ipv6/ipv6_sockglue.c
net/ipv6/mcast.c
net/ipv6/raw.c
net/ipv6/reassembly.c
net/ipv6/route.c
net/ipv6/sit.c
net/ipx/af_ipx.c
net/irda/irnetlink.c
net/llc/af_llc.c
net/llc/llc_core.c
net/mac80211/ieee80211.c
net/mac80211/ieee80211_cfg.c
net/mac80211/tx.c
net/mac80211/util.c
net/netrom/nr_route.c
net/packet/af_packet.c
net/rose/rose_route.c
net/sched/act_mirred.c
net/sched/cls_api.c
net/sched/em_meta.c
net/sched/sch_api.c
net/sctp/ipv6.c
net/sctp/protocol.c
net/socket.c
net/tipc/eth_media.c
net/wireless/wext.c
net/x25/x25_route.c