From: David Ahern <dsahern@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
Christian Brauner <christian.brauner@ubuntu.com>
Cc: netdev@vger.kernel.org, ebiederm@xmission.com, jbenc@redhat.com,
nicolas.dichtel@6wind.com, linux-kernel@vger.kernel.org,
davem@davemloft.net
Subject: Re: [PATCH net 1/1 v1] rtnetlink: require unique netns identifier
Date: Sat, 3 Feb 2018 19:09:55 -0700 [thread overview]
Message-ID: <0e8a86e6-5948-1e91-d937-893eb62ceef1@gmail.com> (raw)
In-Reply-To: <20180203111701.2ff8d7a3@xeon-e3>
On 2/3/18 12:17 PM, Stephen Hemminger wrote:
> On Sat, 3 Feb 2018 14:29:04 +0100
> Christian Brauner <christian.brauner@ubuntu.com> wrote:
>
>> +static int rtnl_ensure_unique_netns_attr(const struct sock *sk,
>> + struct nlattr *tb[],
>> + struct netlink_ext_ack *extack)
>> +{
>> + int ret = -EINVAL;
>> + struct net *net = NULL, *unique_net = NULL;
>> +
>> + /* Requests without network namespace ids have been able to specify
>> + * multiple properties referring to different network namespaces so
>> + * don't regress them.
>> + */
>> + if (!tb[IFLA_IF_NETNSID])
>> + return 0;
>> +
>> + if (!tb[IFLA_NET_NS_PID] && !tb[IFLA_NET_NS_FD])
>> + return 0;
>
> Isn't this an error?
>
>> +
>> + unique_net = get_net_ns_by_id(sock_net(sk), nla_get_s32(tb[IFLA_IF_NETNSID]));
>> + if (!unique_net)
>> + return -1;
>
> Other paths are returning errno, so why -1 here?
>
extack needs to be filled in too.
next prev parent reply other threads:[~2018-02-04 2:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-03 13:29 [PATCH net 0/1 " Christian Brauner
2018-02-03 13:29 ` [PATCH net 1/1 " Christian Brauner
2018-02-03 19:17 ` Stephen Hemminger
2018-02-04 2:09 ` David Ahern [this message]
2018-02-04 12:12 ` Christian Brauner
2018-02-04 12:11 ` Christian Brauner
2018-02-04 17:21 ` David Ahern
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=0e8a86e6-5948-1e91-d937-893eb62ceef1@gmail.com \
--to=dsahern@gmail.com \
--cc=christian.brauner@ubuntu.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=jbenc@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--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
Powered by JetHome