From: Ralf Lici <ralf@mandelbit.com>
To: David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org, Antonio Quartulli <antonio@openvpn.net>,
Sabrina Dubroca <sd@queasysnail.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net 1/1] ovpn: avoid caching stale IPv6 dst after FIB changes
Date: Fri, 18 Sep 2026 08:51:03 +0200 [thread overview]
Message-ID: <20260918065103.28295-1-ralf@mandelbit.com> (raw)
In-Reply-To: <58147155-1763-4e10-a3af-f8751c1505d5@kernel.org>
On Thu, 17 Sep 2026 13:09:10 -0600, David Ahern <dsahern@kernel.org> wrote:
> On 9/17/26 4:09 AM, Ralf Lici wrote:
> > diff --git a/drivers/net/ovpn/udp.c b/drivers/net/ovpn/udp.c
> > index 7f69e8890b5b..a28974cc36e8 100644
> > --- a/drivers/net/ovpn/udp.c
> > +++ b/drivers/net/ovpn/udp.c
> > @@ -250,7 +252,11 @@ static int ovpn_udp6_output(struct ovpn_peer *peer, struct ovpn_bind *bind,
> > dst_cache_reset(cache);
> > }
> >
> > - dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl, NULL);
> > + gen0 = rt_genid_ipv6(net);
>
> this detail about routes should not be buried here. rt_genid_ipv6 really
> should be local to net/ipv6/route.c
>
>
I agree. Keeping this detail inside the IPv6 routing code is exactly why
I sent the RFC linked from the cover letter, and I would appreciate your
thoughts on the proposed approach:
https://lore.kernel.org/netdev/20260901122501.482920-1-ralf@mandelbit.com/
The pattern of obtaining a dst and only later sampling its validation
cookie when publishing it into a persistent cache is widespread in both
drivers and the networking core. It is racy for IPv6 routes with
rt6_info::sernum == 0, because rt6_get_cookie then reads the current
fib6_node::fn_sernum, not necessarily the value corresponding to the
lookup which returned that dst.
--
Ralf Lici
Mandelbit Srl
next prev parent reply other threads:[~2026-09-18 6:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 10:09 [PATCH net 0/1] ovpn: avoid caching stale IPv6 dst after FIB changes Ralf Lici
2026-09-17 10:09 ` [PATCH net 1/1] " Ralf Lici
2026-09-17 19:09 ` David Ahern
2026-09-18 6:51 ` Ralf Lici [this message]
2026-09-18 18:42 ` David Ahern
2026-09-18 20:27 ` Ralf Lici
2026-09-28 8:56 ` Ralf Lici
2026-09-29 14:09 ` David Ahern
2026-09-29 15:04 ` Ralf Lici
2026-10-09 0:33 ` Antonio Quartulli
2026-10-13 13:52 ` 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=20260918065103.28295-1-ralf@mandelbit.com \
--to=ralf@mandelbit.com \
--cc=andrew+netdev@lunn.ch \
--cc=antonio@openvpn.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.