Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: exthdrs: recompute network header pointer once
@ 2026-06-02 21:30 Justin Iurman
  2026-06-03  8:46 ` Ido Schimmel
  0 siblings, 1 reply; 2+ messages in thread
From: Justin Iurman @ 2026-06-02 21:30 UTC (permalink / raw)
  To: netdev; +Cc: davem, dsahern, edumazet, kuba, pabeni, horms, idosch,
	justin.iurman

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>
---
 net/ipv6/exthdrs.c | 9 +++------
 1 file 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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ipv6: exthdrs: recompute network header pointer once
  2026-06-02 21:30 [PATCH net-next] ipv6: exthdrs: recompute network header pointer once Justin Iurman
@ 2026-06-03  8:46 ` Ido Schimmel
  0 siblings, 0 replies; 2+ messages in thread
From: Ido Schimmel @ 2026-06-03  8:46 UTC (permalink / raw)
  To: Justin Iurman; +Cc: netdev, davem, dsahern, edumazet, kuba, pabeni, horms

On Tue, Jun 02, 2026 at 11:30:33PM +0200, Justin Iurman wrote:
> 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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-03  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 21:30 [PATCH net-next] ipv6: exthdrs: recompute network header pointer once Justin Iurman
2026-06-03  8:46 ` Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox