[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250115043635.4429-1-kuniyu@amazon.com>
Date: Wed, 15 Jan 2025 13:36:35 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <stfomichev@...il.com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
<horms@...nel.org>, <kuba@...nel.org>, <kuni1840@...il.com>,
<kuniyu@...zon.com>, <netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH v1 net-next 00/11] ipv6: Convert RTM_{NEW,DEL}ADDR and more to per-netns RTNL.
From: Stanislav Fomichev <stfomichev@...il.com>
Date: Tue, 14 Jan 2025 09:13:52 -0800
> On 01/14, Kuniyuki Iwashima wrote:
> > This series converts RTM_NEWADDR/RTM_DELADDR and some more
> > RTNL users in addrconf.c to per-netns RTNL.
>
> This makes a lot of tests unhappy:
> https://netdev.bots.linux.dev/contest.html?pw-n=0&branch=net-next-2025-01-14--15-00&pw-n=0&pass=0
>
> I have confirmed with a single one (drivers/net/ping.py) on my side,
> fails with:
> STDERR: b'ping: connect: Network is unreachable\n'
Oh sorry, I had to move lifetime validation after cfg.ifa_flags
initialisation, otherwise IFA_F_PERMANENT disappears.
Will squash the diff below to patch 9 in v2.
Thanks!
---8<---
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 721a4bceb107..9ae25a8d1632 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4974,9 +4974,16 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
if (tb[IFA_PROTO])
cfg.ifa_proto = nla_get_u8(tb[IFA_PROTO]);
+ cfg.ifa_flags = nla_get_u32_default(tb[IFA_FLAGS], ifm->ifa_flags);
+
+ /* We ignore other flags so far. */
+ cfg.ifa_flags &= IFA_F_NODAD | IFA_F_HOMEADDRESS |
+ IFA_F_MANAGETEMPADDR | IFA_F_NOPREFIXROUTE |
+ IFA_F_MCAUTOJOIN | IFA_F_OPTIMISTIC;
+
+ cfg.ifa_flags |= IFA_F_PERMANENT;
cfg.valid_lft = INFINITY_LIFE_TIME;
cfg.preferred_lft = INFINITY_LIFE_TIME;
- cfg.ifa_flags |= IFA_F_PERMANENT;
expires = 0;
flags = 0;
@@ -5009,13 +5016,6 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
}
}
- cfg.ifa_flags = nla_get_u32_default(tb[IFA_FLAGS], ifm->ifa_flags);
-
- /* We ignore other flags so far. */
- cfg.ifa_flags &= IFA_F_NODAD | IFA_F_HOMEADDRESS |
- IFA_F_MANAGETEMPADDR | IFA_F_NOPREFIXROUTE |
- IFA_F_MCAUTOJOIN | IFA_F_OPTIMISTIC;
-
dev = __dev_get_by_index(net, ifm->ifa_index);
if (!dev) {
NL_SET_ERR_MSG_MOD(extack, "Unable to find the interface");
---8<---
Powered by blists - more mailing lists