[ulogd2] IPFIX: preliminary fixes, yet unusable

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Wed Jul 29 16:31:40 CEST 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2.git;a=commit;h=438279431c67cb9a0238e7e623911617d5b092d8
commit 438279431c67cb9a0238e7e623911617d5b092d8
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Wed Jul 29 16:27:01 2009 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Wed Jul 29 16:27:01 2009 +0200

    IPFIX: preliminary fixes, yet unusable
    
    This patch is a preliminary fix for the yet-unfinished IPFIX
    support. This patch resolves a couple of bugs that made ulogd
    crash and a couple of missing symbols that didn't allow to
    use this plugin in the configuration file.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  438279431c67cb9a0238e7e623911617d5b092d8 (commit)
      from  0833a30bf3d82ab2c61a57b6257520acdb91a8d6 (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 438279431c67cb9a0238e7e623911617d5b092d8
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Wed Jul 29 16:27:01 2009 +0200

    IPFIX: preliminary fixes, yet unusable
    
    This patch is a preliminary fix for the yet-unfinished IPFIX
    support. This patch resolves a couple of bugs that made ulogd
    crash and a couple of missing symbols that didn't allow to
    use this plugin in the configuration file.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

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

 output/ulogd_output_IPFIX.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
This patch is a preliminary fix for the yet-unfinished IPFIX
support. This patch resolves a couple of bugs that made ulogd
crash and a couple of missing symbols that didn't allow to
use this plugin in the configuration file.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/output/ulogd_output_IPFIX.c b/output/ulogd_output_IPFIX.c
index 88964ef..025faab 100644
--- a/output/ulogd_output_IPFIX.c
+++ b/output/ulogd_output_IPFIX.c
@@ -93,6 +93,7 @@ struct bitmask *bitmask_alloc(unsigned int num_bits)
 		return NULL;
 
 	bm->size_bits = num_bits;
+	bm->buf = (void *)bm + sizeof(*bm);
 
 	bitmask_clear(bm);
 
@@ -240,7 +241,7 @@ build_template_for_bitmask(struct ulogd_pluginstance *upi,
 
 	tmpl->total_length = 0;
 
-	for (i = 0; i < upi->input.num_keys; i++) {
+	for (i = 0, j = 0; i < upi->input.num_keys; i++) {
 		struct ulogd_key *key = &upi->input.keys[i];
 		int length = ulogd_key_size(key);
 
@@ -332,8 +333,7 @@ static int output_ipfix(struct ulogd_pluginstance *upi)
 			ulogd_log(ULOGD_ERROR, "can't build new template!\n");
 			return ULOGD_IRET_ERR;
 		}
-		/* FIXME: prepend? */
-		list_add(&ii->template_list, &template->list);
+		llist_add(&template->list, &ii->template_list);
 	}
 	
 	total_size = template->total_length;
@@ -435,18 +435,14 @@ static int start_ipfix(struct ulogd_pluginstance *pi)
 	if (!ii->valid_bitmask)
 		return -ENOMEM;
 
+	INIT_LLIST_HEAD(&ii->template_list);
+
 	ret = open_connect_socket(pi);
 	if (ret < 0)
 		goto out_bm_free;
 
-	ret = build_template(pi);
-	if (ret < 0)
-		goto out_sock_close;
-
 	return 0;
 
-out_sock_close:
-	close(ii->fd);
 out_bm_free:
 	bitmask_free(ii->valid_bitmask);
 	ii->valid_bitmask = NULL;



More information about the netfilter-cvslog mailing list