summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Iurman <justin.iurman@gmail.com>2026-06-03 00:30:33 +0300
committerJakub Kicinski <kuba@kernel.org>2026-06-04 05:14:56 +0300
commitee5aee77bcba421fd2830e5036a18c206f7c2844 (patch)
treecb759344170a26c347eb3f5a5c3dc888c22abe4b
parent1681cb1bde051c3b9ebbd337c0bfdd3e74167b2f (diff)
downloadlinux-ee5aee77bcba421fd2830e5036a18c206f7c2844.tar.xz
ipv6: exthdrs: recompute network header pointer once
In ip6_parse_tlv(), recompute the network header pointer once regardless of the option processed (Hbh or Dest), as missing recomputation for specific options has caused issues in the past. Signed-off-by: Justin Iurman <justin.iurman@gmail.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260602213033.12244-1-justin.iurman@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--net/ipv6/exthdrs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 43f46ef9c53b..9c677eb1d1a6 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -178,14 +178,10 @@ static bool ip6_parse_tlv(bool hopbyhop,
case IPV6_TLV_IOAM:
if (!ipv6_hop_ioam(skb, off))
return false;
-
- nh = skb_network_header(skb);
break;
case IPV6_TLV_JUMBO:
if (!ipv6_hop_jumbo(skb, off))
return false;
-
- nh = skb_network_header(skb);
break;
case IPV6_TLV_CALIPSO:
if (!ipv6_hop_calipso(skb, off))
@@ -203,8 +199,6 @@ static bool ip6_parse_tlv(bool hopbyhop,
case IPV6_TLV_HAO:
if (!ipv6_dest_hao(skb, off))
return false;
-
- nh = skb_network_header(skb);
break;
#endif
default:
@@ -215,6 +209,9 @@ static bool ip6_parse_tlv(bool hopbyhop,
}
}
padlen = 0;
+
+ /* recompute the network header pointer in case it has changed */
+ nh = skb_network_header(skb);
}
off += optlen;
len -= optlen;