From: Etan Kissling <etan_kissling@apple.com>
To: netfilter-devel@vger.kernel.org
Cc: laforge@netfilter.org
Subject: [PATCH libnetfilter_queue] src: fix header handling in nfq_ip6_set_transport_header
Date: Wed, 13 Jan 2021 10:27:02 +0100 [thread overview]
Message-ID: <79314FEF-4327-422F-886B-92406390E44A@apple.com> (raw)
This corrects issues in IPv6 header handling that sometimes resulted in an endless loop.
Signed-off-by: Etan Kissling <etan_kissling@apple.com>
---
| 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--git a/src/extra/ipv6.c b/src/extra/ipv6.c
index 42c5e25..1eb822f 100644
--- a/src/extra/ipv6.c
+++ b/src/extra/ipv6.c
@@ -72,7 +72,8 @@ int nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
uint32_t hdrlen;
/* No more extensions, we're done. */
- if (nexthdr == IPPROTO_NONE) {
+ if (nexthdr == IPPROTO_TCP || nexthdr == IPPROTO_UDP || nexthdr == IPPROTO_ESP ||
+ nexthdr == IPPROTO_ICMPV6 || nexthdr == IPPROTO_NONE) {
cur = NULL;
break;
}
@@ -107,7 +108,7 @@ int nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
} else if (nexthdr == IPPROTO_AH)
hdrlen = (ip6_ext->ip6e_len + 2) << 2;
else
- hdrlen = ip6_ext->ip6e_len;
+ hdrlen = (ip6_ext->ip6e_len + 1) << 3;
nexthdr = ip6_ext->ip6e_nxt;
cur += hdrlen;
--
2.21.1 (Apple Git-122.3)
reply other threads:[~2021-01-13 22:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=79314FEF-4327-422F-886B-92406390E44A@apple.com \
--to=etan_kissling@apple.com \
--cc=laforge@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).