]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
Fix parsing of ipv6 flowlabel and tc fields
authorBob Hockney <zeus@ix.netcom.com>
Wed, 19 Dec 2012 19:34:57 +0000 (12:34 -0700)
committerEric Leblond <eric@regit.org>
Wed, 19 Dec 2012 22:47:52 +0000 (23:47 +0100)
Mask should be applied after ntohl conversion.

filter/raw2packet/ulogd_raw2packet_BASE.c

index d0fcdfab6c84c3285e2b4df06ec4ece78c7dbe44..05141b815a37d06a5647cb436a3d76a473f6f44d 100644 (file)
@@ -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;