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: mikhail.sennikovskii@ionos.com
Subject: [PATCH conntrack-tools 2/3] conntrack: use IPPROTO_RAW
Date: Fri,  8 Jul 2022 13:18:20 +0200	[thread overview]
Message-ID: <20220708111821.37783-2-pablo@netfilter.org> (raw)
In-Reply-To: <20220708111821.37783-1-pablo@netfilter.org>

IPPROTO_MPTCP defeats the purpose of IPPROTO_MAX to check for the
maximum layer 4 protocol supported in the IP header.

Use IPPROTO_RAW (255) instead.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/conntrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conntrack.c b/src/conntrack.c
index 33f60239580f..4afccde4b027 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -840,7 +840,7 @@ static int parse_proto_num(const char *str)
 	long val;
 
 	val = strtol(str, &endptr, 0);
-	if (val >= IPPROTO_MAX ||
+	if (val > IPPROTO_RAW ||
 	    val < 0 ||
 	    endptr == str ||
 	    *endptr != '\0')
-- 
2.30.2


  reply	other threads:[~2022-07-08 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 11:18 [PATCH conntrack-tools 1/3] conntrack: update manpage with new -A command Pablo Neira Ayuso
2022-07-08 11:18 ` Pablo Neira Ayuso [this message]
2022-07-08 11:18 ` [PATCH conntrack-tools 3/3] conntrack: slightly simplify parse_proto_num() by using strtoul() Pablo Neira Ayuso

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=20220708111821.37783-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=mikhail.sennikovskii@ionos.com \
    --cc=netfilter-devel@vger.kernel.org \
    /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).