[libnetfilter_conntrack] fix wrong ATTR_*_L3PROTO handling in the message building

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Mon Jun 16 02:12:25 CEST 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=libnetfilter_conntrack.git;a=commit;h=29ce47fc611015a64f66d1ec93c67a9d998f0592
commit 29ce47fc611015a64f66d1ec93c67a9d998f0592
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Mon Jun 16 01:58:41 2008 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Mon Jun 16 01:58:41 2008 +0200

    fix wrong ATTR_*_L3PROTO handling in the message building
    
    - include missing ATTR_MASTER_L3PROTO attribute into messages
    - include ATTR_[ORIG|REPL]_L3PROTO iff there is at least another layer 3
    attribute
       via  29ce47fc611015a64f66d1ec93c67a9d998f0592 (commit)
      from  0ceaca69ad2517e156066203111e153084140a18 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 29ce47fc611015a64f66d1ec93c67a9d998f0592
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Mon Jun 16 01:58:41 2008 +0200

    fix wrong ATTR_*_L3PROTO handling in the message building
    
    - include missing ATTR_MASTER_L3PROTO attribute into messages
    - include ATTR_[ORIG|REPL]_L3PROTO iff there is at least another layer 3
    attribute

-----------------------------------------------------------------------

 src/conntrack/parse.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
- include missing ATTR_MASTER_L3PROTO attribute into messages
- include ATTR_[ORIG|REPL]_L3PROTO iff there is at least another layer 3
attribute

diff --git a/src/conntrack/parse.c b/src/conntrack/parse.c
index a18e3ad..7b6c0c5 100644
--- a/src/conntrack/parse.c
+++ b/src/conntrack/parse.c
@@ -379,23 +379,29 @@ void __parse_conntrack(const struct nlmsghdr *nlh,
 {
 	struct nfgenmsg *nfhdr = NLMSG_DATA(nlh);
 
-	ct->tuple[__DIR_ORIG].l3protonum = nfhdr->nfgen_family;
-	set_bit(ATTR_ORIG_L3PROTO, ct->set);
+	if (cda[CTA_TUPLE_ORIG-1]) {
+		ct->tuple[__DIR_ORIG].l3protonum = nfhdr->nfgen_family;
+		set_bit(ATTR_ORIG_L3PROTO, ct->set);
 
-	ct->tuple[__DIR_REPL].l3protonum = nfhdr->nfgen_family;
-	set_bit(ATTR_REPL_L3PROTO, ct->set);
-
-	if (cda[CTA_TUPLE_ORIG-1])
 		__parse_tuple(cda[CTA_TUPLE_ORIG-1], 
 			      &ct->tuple[__DIR_ORIG], __DIR_ORIG, ct->set);
+	}
+
+	if (cda[CTA_TUPLE_REPLY-1]) {
+		ct->tuple[__DIR_REPL].l3protonum = nfhdr->nfgen_family;
+		set_bit(ATTR_REPL_L3PROTO, ct->set);
 
-	if (cda[CTA_TUPLE_REPLY-1])
 		__parse_tuple(cda[CTA_TUPLE_REPLY-1], 
 			      &ct->tuple[__DIR_REPL], __DIR_REPL, ct->set);
+	}
+
+	if (cda[CTA_TUPLE_MASTER-1]) {
+		ct->tuple[__DIR_MASTER].l3protonum = nfhdr->nfgen_family;
+		set_bit(ATTR_MASTER_L3PROTO, ct->set);
 
-	if (cda[CTA_TUPLE_MASTER-1])
 		__parse_tuple(cda[CTA_TUPLE_MASTER-1], 
 			      &ct->tuple[__DIR_MASTER], __DIR_MASTER, ct->set);
+	}
 
 	if (cda[CTA_NAT_SEQ_ADJ_ORIG-1])
 		__parse_nat_seq(cda[CTA_NAT_SEQ_ADJ_ORIG-1], ct, __DIR_ORIG);



More information about the netfilter-cvslog mailing list