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
 #ifndef _IPT_CONNTRACK_H
5
 #ifndef _IPT_CONNTRACK_H
6
 #define _IPT_CONNTRACK_H
6
 #define _IPT_CONNTRACK_H
7
 
7
 
8
+#if 0
8
 #include <linux/netfilter_ipv4/ip_conntrack.h>
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
 /* backwards compatibility crap. only exists in userspace - HW */
15
 /* backwards compatibility crap. only exists in userspace - HW */
11
 #include <linux/version.h>
16
 #include <linux/version.h>

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

59
 #endif
59
 #endif
60
 };
60
 };
61
 
61
 
62
+#if 0
62
 /* Convenience structures */
63
 /* Convenience structures */
63
 struct ipt_error_target
64
 struct ipt_error_target
64
 {
65
 {
65
 	STRUCT_ENTRY_TARGET t;
66
 	STRUCT_ENTRY_TARGET t;
66
 	char error[TABLE_MAXNAMELEN];
67
 	char error[TABLE_MAXNAMELEN];
67
 };
68
 };
69
+#endif
68
 
70
 
69
 struct chain_head;
71
 struct chain_head;
70
 struct rule_head;
72
 struct rule_head;
638
 		head = (void *)repl->entries + c->head_offset;
640
 		head = (void *)repl->entries + c->head_offset;
639
 		head->e.target_offset = sizeof(STRUCT_ENTRY);
641
 		head->e.target_offset = sizeof(STRUCT_ENTRY);
640
 		head->e.next_offset = IPTCB_CHAIN_START_SIZE;
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
 				ALIGN(sizeof(struct ipt_error_target));
645
 				ALIGN(sizeof(struct ipt_error_target));
644
-		strcpy(head->name.error, c->name);
646
+		strcpy(head->name.errorname, c->name);
645
 	} else {
647
 	} else {
646
 		repl->hook_entry[c->hooknum-1] = c->head_offset;	
648
 		repl->hook_entry[c->hooknum-1] = c->head_offset;	
647
 		repl->underflow[c->hooknum-1] = c->foot_offset;
649
 		repl->underflow[c->hooknum-1] = c->foot_offset;
747
 	error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE;
749
 	error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE;
748
 	error->entry.target_offset = sizeof(STRUCT_ENTRY);
750
 	error->entry.target_offset = sizeof(STRUCT_ENTRY);
749
 	error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE;
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
 		ALIGN(sizeof(struct ipt_error_target));
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
 	return 1;
757
 	return 1;
756
 }
758
 }

+ 1
- 3
src/mark.h View File

2
 #define MARK_H
2
 #define MARK_H
3
 
3
 
4
 #include "libiptc/libiptc.h"
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
 #include "libiptc/ipt_conntrack.h"
6
 #include "libiptc/ipt_conntrack.h"
8
 #include "libiptc/ipt_connmark.h"
7
 #include "libiptc/ipt_connmark.h"
9
 #include "libiptc/ipt_CONNMARK.h"
8
 #include "libiptc/ipt_CONNMARK.h"
10
 
9
 
11
-
12
 #define MANGLE_TABLE		"mangle"
10
 #define MANGLE_TABLE		"mangle"
13
 #define FILTER_TABLE		"filter"
11
 #define FILTER_TABLE		"filter"
14
 #define NTK_MARK_CHAIN		"ntk_mark_chain"
12
 #define NTK_MARK_CHAIN		"ntk_mark_chain"

Loading…
Cancel
Save