IPFIX needs some huge work. This patch fixes some basic logic errors.
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
#include <sys/socket.h>
#include <netdb.h>
+#include <ulogd/linuxlist.h>
+
#ifdef IPPROTO_SCTP
/* temporarily disable sctp until we know which headers to use */
#undef IPPROTO_SCTP
struct bitmask *bitmask_dup(const struct bitmask *bm_orig)
{
struct bitmask *bm_new;
- int size = sizoef(*bm_new) + SIZE_OCTETS(bm_orig->size_bits);
+ int size = sizeof(*bm_new) + SIZE_OCTETS(bm_orig->size_bits);
bm_new = malloc(size);
if (!bm_new)
tmpl = malloc(size);
if (!tmpl)
- return -ENOMEM;
+ return NULL;
memset(tmpl, 0, size);
- tmpl->bitmask = dup_bitmask(bm);
+ tmpl->bitmask = bitmask_dup(bm);
if (!tmpl->bitmask) {
free(tmpl);
- return -ENOMEM;
+ return NULL;
}
/* initialize template header */
tmpl->tmpl.hdr.field_count = htons(j);
- return 0;
+ return tmpl;
}