Pārlūkot izejas kodu

Merge pull request #1 from rev22/compilation-fixes

Compilation fixes
Valeska 11 gadus atpakaļ
vecāks
revīzija
b86545adfa
9 mainītis faili ar 54 papildinājumiem un 21 dzēšanām
  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 Parādīt failu

@@ -658,7 +658,7 @@ void igw_order(inet_gw **igws, int *igws_counter, inet_gw **my_igws, int level)
658 658
 	if(!igws_counter[level] || !igws[level])
659 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 663
 	igw=new_head;
664 664
 	list_for(igw) {

+ 0
- 4
src/includes.h Parādīt failu

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

+ 30
- 0
src/libiptc/ipt_CONNMARK.h Parādīt failu

@@ -0,0 +1,30 @@
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 Parādīt failu

@@ -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 Parādīt failu

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

+ 3
- 3
src/llist.c Parādīt failu

@@ -606,9 +606,9 @@ do{                  							\
606 606
  *        should be aware of this.
607 607
  * 	- it follows the new order of `tmp' and appends each array element in
608 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 613
 	l_list *_hcq=(l_list *)(_head), *_ncq, *_hecq, *_tcq;		\
614 614
 	int _icq=0, _ccq;						\
@@ -629,7 +629,7 @@ do{                  							\
629 629
 	for(_icq=0; _icq<_ccq; _icq++)					\
630 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 635
 #endif /*LLIST_C*/

+ 1
- 3
src/mark.h Parādīt failu

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

+ 2
- 2
src/netsukuku.h Parādīt failu

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

+ 4
- 2
src/ntkresolv.c Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt