Browse Source

Fixes for compiling libiptc with recent netfilter headers

Michele Bini 11 years ago
parent
commit
e0a0364f14
3 changed files with 14 additions and 9 deletions
  1. 5
    0
      src/libiptc/ipt_conntrack.h
  2. 8
    6
      src/libiptc/libiptc.c
  3. 1
    3
      src/mark.h

+ 5
- 0
src/libiptc/ipt_conntrack.h View File

@@ -5,7 +5,12 @@
5 5
 #ifndef _IPT_CONNTRACK_H
6 6
 #define _IPT_CONNTRACK_H
7 7
 
8
+#if 0
8 9
 #include <linux/netfilter_ipv4/ip_conntrack.h>
10
+#else
11
+#include <linux/netfilter/nf_conntrack_common.h>
12
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
13
+#endif
9 14
 
10 15
 /* backwards compatibility crap. only exists in userspace - HW */
11 16
 #include <linux/version.h>

+ 8
- 6
src/libiptc/libiptc.c View File

@@ -59,12 +59,14 @@ static const char *hooknames[]
59 59
 #endif
60 60
 };
61 61
 
62
+#if 0
62 63
 /* Convenience structures */
63 64
 struct ipt_error_target
64 65
 {
65 66
 	STRUCT_ENTRY_TARGET t;
66 67
 	char error[TABLE_MAXNAMELEN];
67 68
 };
69
+#endif
68 70
 
69 71
 struct chain_head;
70 72
 struct rule_head;
@@ -638,10 +640,10 @@ static int iptcc_compile_chain(TC_HANDLE_T h, STRUCT_REPLACE *repl, struct chain
638 640
 		head = (void *)repl->entries + c->head_offset;
639 641
 		head->e.target_offset = sizeof(STRUCT_ENTRY);
640 642
 		head->e.next_offset = IPTCB_CHAIN_START_SIZE;
641
-		strcpy(head->name.t.u.user.name, ERROR_TARGET);
642
-		head->name.t.u.target_size = 
643
+		strcpy(head->name.target.u.user.name, ERROR_TARGET);
644
+		head->name.target.u.target_size = 
643 645
 				ALIGN(sizeof(struct ipt_error_target));
644
-		strcpy(head->name.error, c->name);
646
+		strcpy(head->name.errorname, c->name);
645 647
 	} else {
646 648
 		repl->hook_entry[c->hooknum-1] = c->head_offset;	
647 649
 		repl->underflow[c->hooknum-1] = c->foot_offset;
@@ -747,10 +749,10 @@ static int iptcc_compile_table(TC_HANDLE_T h, STRUCT_REPLACE *repl)
747 749
 	error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE;
748 750
 	error->entry.target_offset = sizeof(STRUCT_ENTRY);
749 751
 	error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE;
750
-	error->target.t.u.user.target_size = 
752
+	error->target.target.u.user.target_size = 
751 753
 		ALIGN(sizeof(struct ipt_error_target));
752
-	strcpy((char *)&error->target.t.u.user.name, ERROR_TARGET);
753
-	strcpy((char *)&error->target.error, "ERROR");
754
+	strcpy((char *)&error->target.target.u.user.name, ERROR_TARGET);
755
+	strcpy((char *)&error->target.errorname, "ERROR");
754 756
 
755 757
 	return 1;
756 758
 }

+ 1
- 3
src/mark.h View File

@@ -2,13 +2,11 @@
2 2
 #define MARK_H
3 3
 
4 4
 #include "libiptc/libiptc.h"
5
-#include <linux/netfilter_ipv4/ip_conntrack.h>
6
-#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
5
+#include <linux/netfilter/nf_conntrack_common.h>
7 6
 #include "libiptc/ipt_conntrack.h"
8 7
 #include "libiptc/ipt_connmark.h"
9 8
 #include "libiptc/ipt_CONNMARK.h"
10 9
 
11
-
12 10
 #define MANGLE_TABLE		"mangle"
13 11
 #define FILTER_TABLE		"filter"
14 12
 #define NTK_MARK_CHAIN		"ntk_mark_chain"

Loading…
Cancel
Save