All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Cc: Zhu Yanjun <Yanjun.Zhu@windriver.com>,
	Tonghao Zhang <xiangxia.m.yue@gmail.com>
Subject: Re: [Patch net-next] net: introduce a knob to control whether to inherit devconf config
Date: Fri, 18 Jan 2019 09:25:07 +0100	[thread overview]
Message-ID: <d0547c9a-4b6b-5dc5-11d2-e7c1f05f9414@6wind.com> (raw)
In-Reply-To: <20190118072711.491-1-xiyou.wangcong@gmail.com>

Le 18/01/2019 à 08:27, Cong Wang a écrit :
> There have been many people complaining about the inconsistent
> behaviors of IPv4 and IPv6 devconf when creating new network
> namespaces.  Currently, for IPv4, we inherit all current settings
> from init_net, but for IPv6 we reset all setting to default.
> 
> This patch introduces a new /proc file
> /proc/sys/net/core/devconf_inherit_init_net to control the
> behavior of whether to inhert sysctl current settings from init_net.
> This file itself is only available in init_net.
> 
> As demonstrated below:
> 
> Initial setup in init_net:
>  # cat /proc/sys/net/ipv4/conf/all/rp_filter
>  2
>  # cat /proc/sys/net/ipv6/conf/all/accept_dad
>  1
> 
> Default value 0 (current behavior):
>  # ip netns del test
>  # ip netns add test
>  # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
>  2
>  # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
>  0
> 
> Set to 1 (inherit from init_net):
>  # echo 1 > /proc/sys/net/core/devconf_inherit_init_net
>  # ip netns del test
>  # ip netns add test
>  # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
>  2
>  # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
>  1
> 
> Set to 2 (reset to default):
>  # echo 2 > /proc/sys/net/core/devconf_inherit_init_net
>  # ip netns del test
>  # ip netns add test
>  # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
>  0
>  # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
>  0
> 
> Set to a value out of range (invalid):
>  # echo 3 > /proc/sys/net/core/devconf_inherit_init_net
>  -bash: echo: write error: Invalid argument
>  # echo -1 > /proc/sys/net/core/devconf_inherit_init_net
>  -bash: echo: write error: Invalid argument
> 
> Reported-by: Zhu Yanjun <Yanjun.Zhu@windriver.com>
> Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Nice!

Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

  reply	other threads:[~2019-01-18  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  7:27 [Patch net-next] net: introduce a knob to control whether to inherit devconf config Cong Wang
2019-01-18  8:25 ` Nicolas Dichtel [this message]
2019-01-18 14:38   ` Tonghao Zhang
2019-01-22 19:07 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0547c9a-4b6b-5dc5-11d2-e7c1f05f9414@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=Yanjun.Zhu@windriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiangxia.m.yue@gmail.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.