Skip to content

Make ipv4_devconf (all and default) live in net namespaces

Pavel Emelyanov containers netdev 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 7 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/7Add the netns_ipv4 structinclude/net/net_namespace.h include/net/netns/ipv4.h+11 -01 reply
2/7Make __devinet_sysctl_register return an errornet/ipv4/devinet.c+4 -41 reply
3/7Pass the net pointer to the arp_req_set_proxy()include/net/arp.h net/ipv4/af_inet.c net/ipv4/arp.c+18 -141 reply
4/7Store the net pointer on devinet's ctl tablesnet/ipv4/devinet.c+18 -111 reply
5/7Move the devinet pointers on the struct netinclude/net/netns/ipv4.h net/ipv4/devinet.c+102 -91 reply
6/7Switch users of ipv4_devconf_dflt to use the pernet onenet/ipv4/devinet.c+9 -71 reply
7/7Switch users of ipv4_devconf(_all) to use the pernet oneinclude/linux/inetdevice.h net/ipv4/arp.c net/ipv4/devinet.c +4 more+20 -151 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-2.6.25 0/7] Make ipv4_devconf (all and default) live in net namespaces

The ipv4_devconf_(all) and ipv4_devconf_dflt are currently global, but should be per-namespace.

This set moves them on the struct net. Or, more precisely, on the struct netns_ipv4, which in turn is on the struct net.

There are two minor things that are to be done additionally to this set:

1. The snmp_seq_show() needs the IPV4_DEVCONF_ALL(FORWARDING) value, but since this entry is still global no valid struct net can be get in it, so I use the init_net's one. After snmp is made per-namespace, this will be fixed easily.

2. The rt_fill_info() needs the IPV4_DEVCONF_ALL(MC_FORWARDING), but the routing code is not tuned to work inside namespaces yet, so I use the init_net in it as well. Denis is currently working on ipv4 routing, so this will be prepared shortly.

Happily, all the other places of devconf-s usage can provide a struct net pointer.