netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dsa@cumulusnetworks.com
Cc: xiyou.wangcong@gmail.com, theuns.verwoerd@alliedtelesis.co.nz,
	netdev@vger.kernel.org
Subject: Re: [PATCH] rtnetlink: Handle IFLA_MASTER parameter when processing rtnl_newlink
Date: Tue, 31 Jan 2017 15:49:22 -0500 (EST)	[thread overview]
Message-ID: <20170131.154922.106030849115718252.davem@davemloft.net> (raw)
In-Reply-To: <6a71762b-3e3b-06e6-9b9b-9b00cdbb2cf8@cumulusnetworks.com>

From: David Ahern <dsa@cumulusnetworks.com>
Date: Tue, 31 Jan 2017 13:25:32 -0700

> On 1/30/17 11:49 PM, Cong Wang wrote:
>> On Mon, Jan 30, 2017 at 3:23 PM, Theuns Verwoerd
>> <theuns.verwoerd@alliedtelesis.co.nz> wrote:
>>> @@ -2653,6 +2653,11 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh)
>>>                         if (err < 0)
>>>                                 goto out_unregister;
>>>                 }
>>> +               if (tb[IFLA_MASTER]) {
>>> +                       err = do_set_master(dev, nla_get_u32(tb[IFLA_MASTER]));
>>> +                       if (err)
>>> +                               goto out_unregister;
>>> +               }
>>>  out:
>>>                 if (link_net)
>>>                         put_net(link_net);
>> 
>> Not sure if it is too late to call do_set_master() after
>> dev_change_net_namespace().
>> 
> 
> The master device index is relative to a namespace. If both are given then the namespace change must be done first.

Right and this is exactly how do_setlink() handles this.

  reply	other threads:[~2017-01-31 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 23:23 [PATCH] rtnetlink: Handle IFLA_MASTER parameter when processing rtnl_newlink Theuns Verwoerd
2017-01-30 23:57 ` Stephen Hemminger
2017-01-31  6:49 ` Cong Wang
2017-01-31 20:25   ` David Ahern
2017-01-31 20:49     ` David Miller [this message]
2017-01-31 21:49 ` David Ahern
2017-02-01 16:53 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-01-30 22:28 Theuns Verwoerd
2017-01-30 22:44 ` 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=20170131.154922.106030849115718252.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=theuns.verwoerd@alliedtelesis.co.nz \
    --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 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).