From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <stfomichev@gmail.com>
Cc: <davem@davemloft.net>, <dsahern@kernel.org>,
<edumazet@google.com>, <horms@kernel.org>, <kuba@kernel.org>,
<kuni1840@gmail.com>, <kuniyu@amazon.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>
Subject: Re: [PATCH v1 net-next 00/11] ipv6: Convert RTM_{NEW,DEL}ADDR and more to per-netns RTNL.
Date: Wed, 15 Jan 2025 13:36:35 +0900 [thread overview]
Message-ID: <20250115043635.4429-1-kuniyu@amazon.com> (raw)
In-Reply-To: <Z4abUFyLfalEFCfz@mini-arch>
From: Stanislav Fomichev <stfomichev@gmail.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<---
prev parent reply other threads:[~2025-01-15 4:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 8:05 [PATCH v1 net-next 00/11] ipv6: Convert RTM_{NEW,DEL}ADDR and more to per-netns RTNL Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 01/11] ipv6: Add __in6_dev_get_rtnl_net() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 02/11] ipv6: Convert net.ipv6.conf.${DEV}.XXX sysctl to per-netns RTNL Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 03/11] ipv6: Hold rtnl_net_lock() in addrconf_verify_work() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 04/11] ipv6: Hold rtnl_net_lock() in addrconf_dad_work() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 05/11] ipv6: Hold rtnl_net_lock() in addrconf_init() and addrconf_cleanup() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 06/11] ipv6: Convert inet6_ioctl() to per-netns RTNL Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 07/11] ipv6: Set cfg.ifa_flags before device lookup in inet6_rtm_newaddr() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 08/11] ipv6: Pass dev to inet6_addr_add() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 09/11] ipv6: Move lifetime validation to inet6_rtm_newaddr() Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 10/11] ipv6: Convert inet6_rtm_newaddr() to per-netns RTNL Kuniyuki Iwashima
2025-01-14 8:05 ` [PATCH v1 net-next 11/11] ipv6: Convert inet6_rtm_deladdr() " Kuniyuki Iwashima
2025-01-14 17:13 ` [PATCH v1 net-next 00/11] ipv6: Convert RTM_{NEW,DEL}ADDR and more " Stanislav Fomichev
2025-01-15 4:36 ` Kuniyuki Iwashima [this message]
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=20250115043635.4429-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stfomichev@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).