Thread (4 messages) 4 messages, 2 authors, 2014-10-13

Re: ipv4: net namespace does not inherit network configurations

From: zhuyj <zyjzyj2000@gmail.com>
Date: 2014-07-31 01:59:20
Also in: lkml

On 07/30/2014 01:48 AM, Cong Wang wrote:
On Tue, Jul 29, 2014 at 2:29 AM, zhuyj [off-list ref] wrote:
quoted
Hi,all

I did a test on kernel3.16 rc6:

root@qemu1:~# echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
root@qemu1:~# echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
root@qemu1:~# ip netns list
root@qemu1:~# ip netns add fib1
root@qemu1:~# ip netns exec fib1 bash
root@qemu1:~# cat /proc/sys/net/ipv6/conf/all/forwarding
0
root@qemu1:~# cat /proc/sys/net/ipv4/conf/all/forwarding
1

The behavior of ipv4 and ipv6 is very inconsistent. I checked
the kernel source code. I found that from this patch
[ipv6: fix bad free of addrconf_init_net], the above difference
appeared.

Since a net namespace is independent to another. That is, there
is no any relationship between the net namespaces. So the behavior
of ipv4 is not correct.
Well, they are already independent, not shared, just that the initial
value is duplicated from init_net for IPv4.

This change might break existing applications which rely on this
behavior, but given IPv6 change is almost the same, I think it's ok.

BTW, you need to submit a patch as normal, instead of as an attachment.
OK. Thanks a lot.

Zhu Yanjun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help