From: Eric Leblond <eric@regit.org>
To: netfilter-devel <netfilter-devel@vger.kernel.org>
Cc: Bob Hockney <zeus@ix.netcom.com>, Eric Leblond <eric@regit.org>
Subject: [PATCH 1/3] Fix parsing of ipv6 flowlabel and tc fields
Date: Fri, 21 Dec 2012 15:01:51 +0100 [thread overview]
Message-ID: <1356098513-18684-2-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1356098513-18684-1-git-send-email-eric@regit.org>
From: Bob Hockney <zeus@ix.netcom.com>
Mask should be applied after ntohl conversion.
Signed-off-by: Eric Leblond <eric@regit.org>
---
filter/raw2packet/ulogd_raw2packet_BASE.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/filter/raw2packet/ulogd_raw2packet_BASE.c b/filter/raw2packet/ulogd_raw2packet_BASE.c
index d0fcdfa..05141b8 100644
--- a/filter/raw2packet/ulogd_raw2packet_BASE.c
+++ b/filter/raw2packet/ulogd_raw2packet_BASE.c
@@ -784,9 +784,9 @@ static int _interp_ipv6hdr(struct ulogd_pluginstance *pi, u_int32_t len)
okey_set_u128(&ret[KEY_IP_DADDR], &ipv6h->ip6_dst);
okey_set_u16(&ret[KEY_IP6_PAYLOAD_LEN], ntohs(ipv6h->ip6_plen));
okey_set_u8(&ret[KEY_IP6_PRIORITY],
- ntohl(ipv6h->ip6_flow & 0x0ff00000) >> 20);
+ (ntohl(ipv6h->ip6_flow) & 0x0ff00000) >> 20);
okey_set_u32(&ret[KEY_IP6_FLOWLABEL],
- ntohl(ipv6h->ip6_flow & 0x000fffff));
+ ntohl(ipv6h->ip6_flow) & 0x000fffff);
okey_set_u8(&ret[KEY_IP6_HOPLIMIT], ipv6h->ip6_hlim);
curhdr = ipv6h->ip6_nxt;
--
1.7.10.4
next prev parent reply other threads:[~2012-12-21 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 14:01 [ulogd patches 0/3] IPv6 improvements Eric Leblond
2012-12-21 14:01 ` Eric Leblond [this message]
2012-12-21 14:01 ` [PATCH 2/3] Handle postgresql schemas correctly Eric Leblond
2012-12-21 14:01 ` [PATCH 3/3] Add additional ip6 header fields to database scripts Eric Leblond
2012-12-27 8:22 ` [ulogd patches 0/3] IPv6 improvements Eric Leblond
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=1356098513-18684-2-git-send-email-eric@regit.org \
--to=eric@regit.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=zeus@ix.netcom.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).