Subject: Re: [PATCH net,v2] uapi: linux: restore IPPROTO_MAX to 256 and add IPPROTO_UAPI_MAX

From: Jakub Kicinski <[email-masked]>
Date: Wed, 12 Apr 2023 12:37:18 -0700

On Wed, 12 Apr 2023 18:35:40 +0200 Matthieu Baerts wrote:
> > Is this theoretical, or you think any library might be doing this
> > already? I lack of sufficient knowledge of the MPTCP ecosystem to
> > evaluate myself.  
> 
> This is theoretical.
> 
> But using it with socket's protocol parameter is the only good usage of
> IPPROTO_MAX for me :-D

Perhaps. No strong preference from me. That said I think I can come up
with a good name for the SO use: SO_IPPROTO_MAX (which IMHO it's better
than IPPROTO_UAPI_MAX if Pablo doesn't mind sed'ing?)

The name for a max in proto sense... I'm not sure what that would be.
IPPROTO_MAX_IPPROTO ? IP_IPROTO_MAX ? IP_PROTO_MAX ? Dunno..

> More seriously, I don't see such things when looking at:
> 
> 
> https://codesearch.debian.net/search?q=%5CbIPPROTO_MAX%5Cb&literal=0&perpkg=1
> 
> IPPROTO_MAX is (re)defined in different libs but not used in many
> programs, mainly in Netfilter related programs in fact.
> 
> 
> Even if it is linked to MPTCP, I cannot judge if it can be an issue or
> not because it depends on how the different libC or other libs/apps are
> interpreting this IPPROTO_MAX and if they are using it before creating a
> socket.