X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fiptables.c;h=606b24d9afdacfeda05ecd30a44f4976d674377a;hb=ab2e3c958d3fed41438a8b3c2d0cca21b1bca56f;hp=69cd39c48758f352d548764cd20b76f8617153b5;hpb=79c87aeda9172e219a842e393c6499c8bf37662a;p=collectd.git diff --git a/src/iptables.c b/src/iptables.c index 69cd39c4..606b24d9 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -1,8 +1,8 @@ /** * collectd - src/iptables.c - * Copyright (C) 2007 Sjoerd van der Berg - * Copyright (C) 2007 Florian octo Forster - * Copyright (C) 2009 Marco Chiappero + * Copyright (C) 2007 Sjoerd van der Berg + * Copyright (C) 2007-2010 Florian octo Forster + * Copyright (C) 2009 Marco Chiappero * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -20,7 +20,7 @@ * * Authors: * Sjoerd van der Berg - * Florian Forster + * Florian Forster * Marco Chiappero **/ @@ -31,13 +31,8 @@ #include -#if OWN_LIBIPTC -# include "owniptc/libiptc.h" -# include "owniptc/libip6tc.h" -#else -# include -# include -#endif +#include +#include /* * iptc_handle_t was available before libiptc was officially available as a @@ -218,6 +213,7 @@ static int iptables_config (const char *key, const char *value) char errbuf[1024]; ERROR ("realloc failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); + sfree (temp.rule.comment); return (1); } @@ -228,6 +224,7 @@ static int iptables_config (const char *key, const char *value) char errbuf[1024]; ERROR ("malloc failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); + sfree (temp.rule.comment); return (1); } memcpy (final, &temp, sizeof (temp)); @@ -293,11 +290,11 @@ static int submit6_match (const struct ip6t_entry_match *match, } sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type)); - values[0].counter = (counter_t) entry->counters.bcnt; + values[0].derive = (derive_t) entry->counters.bcnt; plugin_dispatch_values (&vl); sstrncpy (vl.type, "ipt_packets", sizeof (vl.type)); - values[0].counter = (counter_t) entry->counters.pcnt; + values[0].derive = (derive_t) entry->counters.pcnt; plugin_dispatch_values (&vl); return (0); @@ -354,11 +351,11 @@ static int submit_match (const struct ipt_entry_match *match, } sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type)); - values[0].counter = (counter_t) entry->counters.bcnt; + values[0].derive = (derive_t) entry->counters.bcnt; plugin_dispatch_values (&vl); sstrncpy (vl.type, "ipt_packets", sizeof (vl.type)); - values[0].counter = (counter_t) entry->counters.pcnt; + values[0].derive = (derive_t) entry->counters.pcnt; plugin_dispatch_values (&vl); return (0);