Subject: Re: [syzbot] [net?] WARNING in mpls_gso_segment

From: Florian Westphal <[email-masked]>
Date: Thu, 22 Feb 2024 13:57:38 +0100

Eric Dumazet <[email-masked]> wrote:
> I was thinking about adding a debug check in skb_inner_network_header(skb)
> if inner_network_header is zero (that would mean it is not 'set' yet),
> but this would trigger even after your patch.

What about adding:

static inline bool skb_inner_network_header_was_set(const struct sk_buff *skb)
{
	return skb->inner_network_header > 0;
}

... and using that instead of checking for negative header length
post-subtraction?