netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Matteo Croce <mcroce@redhat.com>
Cc: netdev <netdev@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH iproute2 v2 0/3] refactor the cmd_exec()
Date: Mon, 17 Jun 2019 16:24:23 -0600	[thread overview]
Message-ID: <b4f39729-d208-8a71-6f6d-f05f00b7ec2b@gmail.com> (raw)
In-Reply-To: <CAGnkfhz940SbWpKau0j13rzqH7Zw7BKTStuCcSeg9EQBLeaEOg@mail.gmail.com>

On 6/17/19 4:20 PM, Matteo Croce wrote:
> 
> I looked for every occourrence of netns_switch():
> 
> bridge/bridge.c:                        if (netns_switch(argv[1]))
> include/namespace.h:int netns_switch(char *netns);
> ip/ip.c:                        if (netns_switch(argv[1]))
> ip/ipnetns.c:   if (netns_switch(argv[0]))
> lib/namespace.c:int netns_switch(char *name)
> lib/utils.c:    if (netns_switch(nsname))
> misc/ss.c:                      if (netns_switch(optarg))
> tc/tc.c:                        if (netns_switch(argv[1]))
> 
> the ones in {ss,tc,bridge,ip}.c are obviously handling the '-n netns'
> command line option.
> my question here is: should the VRF association be reset in all these cases?
> If we need to reset, we should really call vrf_reset() from netns_switch().
> If don't, I can add the missing vrf_reset() in ipnetns.c but I'm
> curious to know what can happen to change netns and keep VRF
> associations belonging to another netns.
> 

The VRF reset is needed on a netns exec - ie., running a command in a
network namespace.

Any netns_switch that only involves sending a netlink command in a
different namespace does not need the reset.

  reply	other threads:[~2019-06-17 22:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 16:10 [PATCH iproute2 v2 0/3] refactor the cmd_exec() Matteo Croce
2019-06-11 16:10 ` [PATCH iproute2 v2 1/3] netns: switch netns in the child when executing commands Matteo Croce
2019-06-11 16:10 ` [PATCH iproute2 v2 2/3] ip vrf: use hook to change VRF in the child Matteo Croce
2019-06-11 16:10 ` [PATCH iproute2 v2 3/3] netns: make netns_{save,restore} static Matteo Croce
2019-06-13 17:07 ` [PATCH iproute2 v2 0/3] refactor the cmd_exec() Andrea Claudi
2019-06-14 14:35 ` David Ahern
2019-06-15 14:06   ` Matteo Croce
2019-06-17 22:20     ` Matteo Croce
2019-06-17 22:24       ` David Ahern [this message]
2019-06-18 14:49 Matteo Croce
2019-06-18 15:41 ` Matteo Croce
2019-06-20 21:31 ` Stephen Hemminger

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=b4f39729-d208-8a71-6f6d-f05f00b7ec2b@gmail.com \
    --to=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=mcroce@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).