From e0a0364f146c6c05773a5eccab7de9fe6ce7c276 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Mon, 30 Sep 2013 08:53:44 +0200 Subject: [PATCH] Fixes for compiling libiptc with recent netfilter headers --- src/libiptc/ipt_conntrack.h | 5 +++++ src/libiptc/libiptc.c | 14 ++++++++------ src/mark.h | 4 +--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/libiptc/ipt_conntrack.h b/src/libiptc/ipt_conntrack.h index eba410d..cccf761 100644 --- a/src/libiptc/ipt_conntrack.h +++ b/src/libiptc/ipt_conntrack.h @@ -5,7 +5,12 @@ #ifndef _IPT_CONNTRACK_H #define _IPT_CONNTRACK_H +#if 0 #include +#else +#include +#include +#endif /* backwards compatibility crap. only exists in userspace - HW */ #include diff --git a/src/libiptc/libiptc.c b/src/libiptc/libiptc.c index c747262..04dd7bc 100644 --- a/src/libiptc/libiptc.c +++ b/src/libiptc/libiptc.c @@ -59,12 +59,14 @@ static const char *hooknames[] #endif }; +#if 0 /* Convenience structures */ struct ipt_error_target { STRUCT_ENTRY_TARGET t; char error[TABLE_MAXNAMELEN]; }; +#endif struct chain_head; struct rule_head; @@ -638,10 +640,10 @@ static int iptcc_compile_chain(TC_HANDLE_T h, STRUCT_REPLACE *repl, struct chain head = (void *)repl->entries + c->head_offset; head->e.target_offset = sizeof(STRUCT_ENTRY); head->e.next_offset = IPTCB_CHAIN_START_SIZE; - strcpy(head->name.t.u.user.name, ERROR_TARGET); - head->name.t.u.target_size = + strcpy(head->name.target.u.user.name, ERROR_TARGET); + head->name.target.u.target_size = ALIGN(sizeof(struct ipt_error_target)); - strcpy(head->name.error, c->name); + strcpy(head->name.errorname, c->name); } else { repl->hook_entry[c->hooknum-1] = c->head_offset; repl->underflow[c->hooknum-1] = c->foot_offset; @@ -747,10 +749,10 @@ static int iptcc_compile_table(TC_HANDLE_T h, STRUCT_REPLACE *repl) error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE; error->entry.target_offset = sizeof(STRUCT_ENTRY); error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE; - error->target.t.u.user.target_size = + error->target.target.u.user.target_size = ALIGN(sizeof(struct ipt_error_target)); - strcpy((char *)&error->target.t.u.user.name, ERROR_TARGET); - strcpy((char *)&error->target.error, "ERROR"); + strcpy((char *)&error->target.target.u.user.name, ERROR_TARGET); + strcpy((char *)&error->target.errorname, "ERROR"); return 1; } diff --git a/src/mark.h b/src/mark.h index 3915a16..bb4ce22 100644 --- a/src/mark.h +++ b/src/mark.h @@ -2,13 +2,11 @@ #define MARK_H #include "libiptc/libiptc.h" -#include -#include +#include #include "libiptc/ipt_conntrack.h" #include "libiptc/ipt_connmark.h" #include "libiptc/ipt_CONNMARK.h" - #define MANGLE_TABLE "mangle" #define FILTER_TABLE "filter" #define NTK_MARK_CHAIN "ntk_mark_chain"