[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae1d28b3-f62f-c58e-d478-980f47fe4fea@6wind.com>
Date: Tue, 5 Nov 2019 16:47:44 +0100
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Jonas Bonn <jonas@...rbonn.se>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: davem@...emloft.net
Subject: Re: [PATCH 4/5] net: ipv4: allow setting address on interface outside
current namespace
Le 05/11/2019 à 09:11, Jonas Bonn a écrit :
> This patch allows an interface outside of the current namespace to be
> selected when setting a new IPv4 address for a device. This uses the
> IFA_TARGET_NETNSID attribute to select the namespace in which to search
> for the interface to act upon.
>
> Signed-off-by: Jonas Bonn <jonas@...rbonn.se>
> ---
[snip]
> @@ -945,10 +961,11 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
>
> if (ret < 0) {
> inet_free_ifa(ifa);
> - return ret;
> + err = ret;
> + goto out;
> }
> }
> - return __inet_insert_ifa(ifa, nlh, NETLINK_CB(skb).portid,
> + err = __inet_insert_ifa(ifa, nlh, NETLINK_CB(skb).portid,
> extack);
if (err < 0)
goto out;
?
else err is set to 0 later.
> } else {
> u32 new_metric = ifa->ifa_rt_priority;
> @@ -956,8 +973,10 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
> inet_free_ifa(ifa);
>
> if (nlh->nlmsg_flags & NLM_F_EXCL ||
> - !(nlh->nlmsg_flags & NLM_F_REPLACE))
> - return -EEXIST;
> + !(nlh->nlmsg_flags & NLM_F_REPLACE)) {
> + err = -EEXIST;
> + goto out;
> + }
> ifa = ifa_existing;
>
> if (ifa->ifa_rt_priority != new_metric) {
> @@ -971,7 +990,14 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
> &check_lifetime_work, 0);
> rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
> }
> - return 0;
> +
> + err = 0;
here.
Regards,
Nicolas
Powered by blists - more mailing lists