net: ipv6: ioam6: fix double reallocation
authorJustin Iurman <justin.iurman@uliege.be>
Tue, 15 Apr 2025 11:25:54 +0000 (13:25 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 17 Apr 2025 10:52:34 +0000 (12:52 +0200)
commit47ce7c854563fe8450e9cb8dcd62c6470e28076b
tree5ae530496286f1f3668847ca49314af64b8da630
parentd55acb9732d981c7a8e07dd63089a77d2938e382
net: ipv6: ioam6: fix double reallocation

If the dst_entry is the same post transformation (which is a valid use
case for IOAM), we don't add it to the cache to avoid a reference loop.
Instead, we use a "fake" dst_entry and add it to the cache as a signal.
When we read the cache, we compare it with our "fake" dst_entry and
therefore detect if we're in the special case.

Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Link: https://patch.msgid.link/20250415112554.23823-3-justin.iurman@uliege.be
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv6/ioam6_iptunnel.c