From: Stephen Hemminger <stephen@networkplumber.org>
To: 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,
dsahern@gmail.com, davem@davemloft.net
Subject: Re: [PATCH net 1/1 v1] rtnetlink: require unique netns identifier
Date: Sat, 3 Feb 2018 11:17:01 -0800 [thread overview]
Message-ID: <20180203111701.2ff8d7a3@xeon-e3> (raw)
In-Reply-To: <20180203132904.11972-2-christian.brauner@ubuntu.com>
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?
next prev parent reply other threads:[~2018-02-03 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-03 13:29 [PATCH net 0/1 v1] rtnetlink: require unique netns identifier Christian Brauner
2018-02-03 13:29 ` [PATCH net 1/1 " Christian Brauner
2018-02-03 19:17 ` Stephen Hemminger [this message]
2018-02-04 2:09 ` David Ahern
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=20180203111701.2ff8d7a3@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=christian.brauner@ubuntu.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=ebiederm@xmission.com \
--cc=jbenc@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.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).