]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
seg6: separate dst_cache for input and output paths in seg6 lwtunnel
authorAndrea Mayer <andrea.mayer@uniroma2.it>
Sat, 4 Apr 2026 00:44:04 +0000 (02:44 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Apr 2026 03:20:56 +0000 (20:20 -0700)
commitc3812651b522fe8437ebb7063b75ddb95b571643
treeba2a704554c585963302b075a8976f8120b8b423
parentefaa71faf212324ecbf6d5339e9717fe53254f58
seg6: separate dst_cache for input and output paths in seg6 lwtunnel

The seg6 lwtunnel uses a single dst_cache per encap route, shared
between seg6_input_core() and seg6_output_core(). These two paths
can perform the post-encap SID lookup in different routing contexts
(e.g., ip rules matching on the ingress interface, or VRF table
separation). Whichever path runs first populates the cache, and the
other reuses it blindly, bypassing its own lookup.

Fix this by splitting the cache into cache_input and cache_output,
so each path maintains its own cached dst independently.

Fixes: 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
Cc: stable@vger.kernel.org
Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
Link: https://patch.msgid.link/20260404004405.4057-2-andrea.mayer@uniroma2.it
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/seg6_iptunnel.c