Browse Source

Merge pull request #1 from rev22/compilation-fixes

Compilation fixes
Valeska 11 years ago
parent
commit
b86545adfa
9 changed files with 54 additions and 21 deletions
  1. 1
    1
      src/igs.c
  2. 0
    4
      src/includes.h
  3. 30
    0
      src/libiptc/ipt_CONNMARK.h
  4. 5
    0
      src/libiptc/ipt_conntrack.h
  5. 8
    6
      src/libiptc/libiptc.c
  6. 3
    3
      src/llist.c
  7. 1
    3
      src/mark.h
  8. 2
    2
      src/netsukuku.h
  9. 4
    2
      src/ntkresolv.c

+ 1
- 1
src/igs.c View File

658
 	if(!igws_counter[level] || !igws[level])
658
 	if(!igws_counter[level] || !igws[level])
659
 		return;
659
 		return;
660
 	
660
 	
661
-	new_head=clist_qsort(igws[level], igws_counter[level], igw_cmp);
661
+	clist_qsort(new_head, igws[level], igws_counter[level], igw_cmp);
662
 	
662
 	
663
 	igw=new_head;
663
 	igw=new_head;
664
 	list_for(igw) {
664
 	list_for(igw) {

+ 0
- 4
src/includes.h View File

27
 #include <stdarg.h>
27
 #include <stdarg.h>
28
 #include <errno.h>
28
 #include <errno.h>
29
 #include <sys/time.h>
29
 #include <sys/time.h>
30
-
31
-#include <asm/bitops.h>
32
-#include <asm/types.h>
33
 #include <sys/types.h>
30
 #include <sys/types.h>
34
-
35
 #include <sys/socket.h>
31
 #include <sys/socket.h>
36
 #include <arpa/inet.h>
32
 #include <arpa/inet.h>
37
 #include <sys/sendfile.h>
33
 #include <sys/sendfile.h>

+ 30
- 0
src/libiptc/ipt_CONNMARK.h View File

1
+#ifndef _IPT_CONNMARK_H_target
2
+#define _IPT_CONNMARK_H_target
3
+
4
+/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
5
+ * by Henrik Nordstrom <hno@marasystems.com>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * (at your option) any later version.
11
+ */
12
+
13
+enum {
14
+	IPT_CONNMARK_SET = 0,
15
+	IPT_CONNMARK_SAVE,
16
+	IPT_CONNMARK_RESTORE
17
+};
18
+
19
+struct ipt_connmark_target_info {
20
+#ifdef KERNEL_64_USERSPACE_32
21
+	unsigned long long mark;
22
+	unsigned long long mask;
23
+#else
24
+	unsigned long mark;
25
+	unsigned long mask;
26
+#endif
27
+	u_int8_t mode;
28
+};
29
+
30
+#endif /*_IPT_CONNMARK_H_target*/

+ 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
 }

+ 3
- 3
src/llist.c View File

606
  *        should be aware of this.
606
  *        should be aware of this.
607
  * 	- it follows the new order of `tmp' and appends each array element in
607
  * 	- it follows the new order of `tmp' and appends each array element in
608
  * 	  a new llist.
608
  * 	  a new llist.
609
- * 	- the head of the new llist is returned.
609
+ * 	- the head of the new llist is assigned to _new_head
610
  */
610
  */
611
-#define clist_qsort(_head, _counter, _cmp_func)				\
611
+#define clist_qsort(_new_head, _head, _counter, _cmp_func)		\
612
 ({									\
612
 ({									\
613
 	l_list *_hcq=(l_list *)(_head), *_ncq, *_hecq, *_tcq;		\
613
 	l_list *_hcq=(l_list *)(_head), *_ncq, *_hecq, *_tcq;		\
614
 	int _icq=0, _ccq;						\
614
 	int _icq=0, _ccq;						\
629
 	for(_icq=0; _icq<_ccq; _icq++)					\
629
 	for(_icq=0; _icq<_ccq; _icq++)					\
630
 		_tcq=(l_list *)list_append(0, _tcq, _tmp_list[_icq]);	\
630
 		_tcq=(l_list *)list_append(0, _tcq, _tmp_list[_icq]);	\
631
 									\
631
 									\
632
-	(typeof((_head)))_hecq;						\
632
+	_new_head = (typeof((_head)))_hecq;						\
633
 })									\
633
 })									\
634
 
634
 
635
 #endif /*LLIST_C*/
635
 #endif /*LLIST_C*/

+ 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"

+ 2
- 2
src/netsukuku.h View File

22
 #include "config.h"
22
 #include "config.h"
23
 #include "igs.h"
23
 #include "igs.h"
24
 
24
 
25
-#define VERSION_STR				"NetsukukuD "VERSION
25
+#define VERSION_STR				"NetsukukuD "PACKAGE_VERSION
26
 
26
 
27
 #ifdef DEBUG
27
 #ifdef DEBUG
28
 #undef VERSION_STR
28
 #undef VERSION_STR
29
-#define VERSION_STR				"NetsukukuD "VERSION" (debug)"
29
+#define VERSION_STR				"NetsukukuD "PACKAGE_VERSION" (debug)"
30
 #endif
30
 #endif
31
 
31
 
32
 /*
32
 /*

+ 4
- 2
src/ntkresolv.c View File

1
+#include <netinet/in.h>
2
+
1
 #include "includes.h"
3
 #include "includes.h"
2
 
4
 
3
 #include "ntkresolv.h"
5
 #include "ntkresolv.h"
295
 				ntkresolv_safe_exit(1);
297
 				ntkresolv_safe_exit(1);
296
 			}
298
 			}
297
 			G_ALIGN(16);
299
 			G_ALIGN(16);
298
-			memcpy(GQT->qstdata,&i6a.in6_u,16);
300
+			memcpy(GQT->qstdata,&i6a.__in6_u,16);
299
 			GQT->ipv=ANDNS_IPV6;
301
 			GQT->ipv=ANDNS_IPV6;
300
 			return;
302
 			return;
301
 		case QTYPE_G:
303
 		case QTYPE_G:
377
 			via=(void*)(&ia);
379
 			via=(void*)(&ia);
378
 			break;
380
 			break;
379
 		case AF_INET6:
381
 		case AF_INET6:
380
-			memcpy(&(i6a.in6_u),data,16);
382
+			memcpy(&(i6a.__in6_u),data,16);
381
 			via=(void*)(&i6a);
383
 			via=(void*)(&i6a);
382
 			break;
384
 			break;
383
 		default:
385
 		default:

Loading…
Cancel
Save