netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org,
	pabeni@redhat.com, edumazet@google.com
Subject: Re: [PATCH net] uapi: linux: restore IPPROTO_MAX to 256
Date: Thu, 12 Jan 2023 11:54:21 +0100	[thread overview]
Message-ID: <Y7/m3SCtogiLmqjn@salvia> (raw)
In-Reply-To: <20230111214719.194027-1-pablo@netfilter.org>

On Wed, Jan 11, 2023 at 10:47:19PM +0100, Pablo Neira Ayuso wrote:
> IPPROTO_MAX used to be 256, but with the introduction of IPPROTO_MPTCP
> definition, IPPROTO_MAX was bumped to 263.
> 
> IPPROTO_MPTCP definition is used for the socket interface from
> userspace. It is never used in the layer 4 protocol field of
> IP headers.
> 
> IPPROTO_* definitions are used anywhere in the kernel as well as in
> userspace to set the layer 4 protocol field in IP headers.
> 
> At least in Netfilter, there is code in userspace that relies on
> IPPROTO_MAX (not inclusive) to check for the maximum layer 4 protocol.
> 
> This patch restores IPPROTO_MAX to 256.
> 
> Fixes: faf391c3826c ("tcp: Define IPPROTO_MPTCP")
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> Alternatively, I can also define an internal __IPPROTO_MAX to 256 in
> userspace.  I understand an update on uapi at this stage might be
> complicated. Another possibility is to add a new definition
> IPPROTO_FIELD_MAX to uapi and set it to 256 that userspace could start
> using.

Scratch this.

This breaks inet_create() and inet6_create() which is going to break
MP-TCP with socket().

I'll post a v2 adding a new IPPROTO_FIELD_MAX definition 256.

      reply	other threads:[~2023-01-12 11:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 21:47 [PATCH net] uapi: linux: restore IPPROTO_MAX to 256 Pablo Neira Ayuso
2023-01-12 10:54 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7/m3SCtogiLmqjn@salvia \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).