From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH net-next 2/6] netfilter: nft_extdhr: Drop pointless check of tprot_set
Date: Wed, 23 Jun 2021 19:02:37 +0200 [thread overview]
Message-ID: <20210623170241.59902-3-pablo@netfilter.org> (raw)
In-Reply-To: <20210623170241.59902-1-pablo@netfilter.org>
From: Phil Sutter <phil@nwl.cc>
Pablo says, tprot_set is only there to detect if tprot was set to
IPPROTO_IP as that evaluates to zero. Therefore, code asserting a
different value in tprot does not need to check tprot_set.
Fixes: 935b7f6430188 ("netfilter: nft_exthdr: add TCP option matching")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nft_exthdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c
index 9cf86be2cff4..4f583d2e220e 100644
--- a/net/netfilter/nft_exthdr.c
+++ b/net/netfilter/nft_exthdr.c
@@ -164,7 +164,7 @@ nft_tcp_header_pointer(const struct nft_pktinfo *pkt,
{
struct tcphdr *tcph;
- if (!pkt->tprot_set || pkt->tprot != IPPROTO_TCP)
+ if (pkt->tprot != IPPROTO_TCP)
return NULL;
tcph = skb_header_pointer(pkt->skb, nft_thoff(pkt), sizeof(*tcph), buffer);
--
2.30.2
next prev parent reply other threads:[~2021-06-23 17:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 17:02 [PATCH net-next 0/6] Netfilter updates for net-next Pablo Neira Ayuso
2021-06-23 17:02 ` [PATCH net-next 1/6] netfilter: nft_exthdr: Search chunks in SCTP packets only Pablo Neira Ayuso
2021-06-23 17:02 ` Pablo Neira Ayuso [this message]
2021-06-23 17:02 ` [PATCH net-next 3/6] netfilter: nf_tables: add last expression Pablo Neira Ayuso
2021-06-23 17:02 ` [PATCH net-next 4/6] netfilter: conntrack: pass hook state to log functions Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2021-06-23 17:02 [PATCH net-next 0/6] Netfilter updates for net-next Pablo Neira Ayuso
2021-06-23 17:02 ` [PATCH net-next 2/6] netfilter: nft_extdhr: Drop pointless check of tprot_set 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=20210623170241.59902-3-pablo@netfilter.org \
--to=pablo@netfilter.org \
--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).