diff --git a/src/igs.c b/src/igs.c index aa38a69..58ad34b 100644 --- a/src/igs.c +++ b/src/igs.c @@ -658,7 +658,7 @@ void igw_order(inet_gw **igws, int *igws_counter, inet_gw **my_igws, int level) if(!igws_counter[level] || !igws[level]) return; - new_head=clist_qsort(igws[level], igws_counter[level], igw_cmp); + clist_qsort(new_head, igws[level], igws_counter[level], igw_cmp); igw=new_head; list_for(igw) { diff --git a/src/includes.h b/src/includes.h index 609b6da..519a100 100644 --- a/src/includes.h +++ b/src/includes.h @@ -27,11 +27,7 @@ #include #include #include - -#include -#include #include - #include #include #include diff --git a/src/libiptc/ipt_CONNMARK.h b/src/libiptc/ipt_CONNMARK.h new file mode 100644 index 0000000..0148539 --- /dev/null +++ b/src/libiptc/ipt_CONNMARK.h @@ -0,0 +1,30 @@ +#ifndef _IPT_CONNMARK_H_target +#define _IPT_CONNMARK_H_target + +/* Copyright (C) 2002,2004 MARA Systems AB + * by Henrik Nordstrom + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +enum { + IPT_CONNMARK_SET = 0, + IPT_CONNMARK_SAVE, + IPT_CONNMARK_RESTORE +}; + +struct ipt_connmark_target_info { +#ifdef KERNEL_64_USERSPACE_32 + unsigned long long mark; + unsigned long long mask; +#else + unsigned long mark; + unsigned long mask; +#endif + u_int8_t mode; +}; + +#endif /*_IPT_CONNMARK_H_target*/ 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/llist.c b/src/llist.c index df92300..a10707c 100644 --- a/src/llist.c +++ b/src/llist.c @@ -606,9 +606,9 @@ do{ \ * should be aware of this. * - it follows the new order of `tmp' and appends each array element in * a new llist. - * - the head of the new llist is returned. + * - the head of the new llist is assigned to _new_head */ -#define clist_qsort(_head, _counter, _cmp_func) \ +#define clist_qsort(_new_head, _head, _counter, _cmp_func) \ ({ \ l_list *_hcq=(l_list *)(_head), *_ncq, *_hecq, *_tcq; \ int _icq=0, _ccq; \ @@ -629,7 +629,7 @@ do{ \ for(_icq=0; _icq<_ccq; _icq++) \ _tcq=(l_list *)list_append(0, _tcq, _tmp_list[_icq]); \ \ - (typeof((_head)))_hecq; \ + _new_head = (typeof((_head)))_hecq; \ }) \ #endif /*LLIST_C*/ 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" diff --git a/src/netsukuku.h b/src/netsukuku.h index 32cefa2..849f6e0 100644 --- a/src/netsukuku.h +++ b/src/netsukuku.h @@ -22,11 +22,11 @@ #include "config.h" #include "igs.h" -#define VERSION_STR "NetsukukuD "VERSION +#define VERSION_STR "NetsukukuD "PACKAGE_VERSION #ifdef DEBUG #undef VERSION_STR -#define VERSION_STR "NetsukukuD "VERSION" (debug)" +#define VERSION_STR "NetsukukuD "PACKAGE_VERSION" (debug)" #endif /* diff --git a/src/ntkresolv.c b/src/ntkresolv.c index 8a11d93..beb708f 100644 --- a/src/ntkresolv.c +++ b/src/ntkresolv.c @@ -1,3 +1,5 @@ +#include + #include "includes.h" #include "ntkresolv.h" @@ -295,7 +297,7 @@ void opts_set_question(char *arg) ntkresolv_safe_exit(1); } G_ALIGN(16); - memcpy(GQT->qstdata,&i6a.in6_u,16); + memcpy(GQT->qstdata,&i6a.__in6_u,16); GQT->ipv=ANDNS_IPV6; return; case QTYPE_G: @@ -377,7 +379,7 @@ void ip_bin_to_str(void *data,char *dst) via=(void*)(&ia); break; case AF_INET6: - memcpy(&(i6a.in6_u),data,16); + memcpy(&(i6a.__in6_u),data,16); via=(void*)(&i6a); break; default: