Import IPFilter 4.1.34 into NetBSD
4.1.34 - Release 11 March 2010
2964907 uninitialised use compile error
2959506 ipfstat does not display rules with compat
2949139 FR_T_BUILTIN masked out incorrectly
2937422
packets filtered with pools should not be cached
2935529 use of rules with tags leads to deadlock
2917501 whitespace cleanup required
2881514 in/out object functions not wired for compatibility
2841771 ipf/ippool rule maintenace bugs: memory leak, ref-counter bug
2839698 H.323 proxy does not clear fin_state/fin_nat
This commit is contained in:
parent
96a3ffaf7c
commit
abd0900a99
4
dist/ipf/arc4random.c
vendored
4
dist/ipf/arc4random.c
vendored
@ -70,7 +70,7 @@ arc4_swap(u_int8_t *a, u_int8_t *b)
|
||||
c = *a;
|
||||
*a = *b;
|
||||
*b = c;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Stir our S-box.
|
||||
@ -160,7 +160,7 @@ arc4rand(void *ptr, u_int len, int reseed)
|
||||
struct timeval tv;
|
||||
|
||||
GETKTIME(&tv);
|
||||
if (reseed ||
|
||||
if (reseed ||
|
||||
(arc4_numruns > ARC4_RESEED_BYTES) ||
|
||||
(tv.tv_sec > arc4_t_reseed))
|
||||
arc4_randomstir();
|
||||
|
2235
dist/ipf/ip_fil_compat.c
vendored
Normal file
2235
dist/ipf/ip_fil_compat.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
dist/ipf/ip_sync.c
vendored
6
dist/ipf/ip_sync.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ip_sync.c,v 1.1.1.7 2009/08/19 08:28:41 darrenr Exp $ */
|
||||
/* $NetBSD: ip_sync.c,v 1.1.1.8 2010/04/17 20:44:16 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995-1998 by Darren Reed.
|
||||
@ -101,7 +101,7 @@ struct file;
|
||||
/* END OF INCLUDES */
|
||||
|
||||
#if !defined(lint)
|
||||
static const char rcsid[] = "@(#)Id: ip_sync.c,v 2.40.2.16 2009/01/27 08:33:23 darrenr Exp";
|
||||
static const char rcsid[] = "@(#)Id: ip_sync.c,v 2.40.2.17 2009/12/27 06:55:22 darrenr Exp";
|
||||
#endif
|
||||
|
||||
#define SYNC_STATETABSZ 256
|
||||
@ -110,7 +110,7 @@ static const char rcsid[] = "@(#)Id: ip_sync.c,v 2.40.2.16 2009/01/27 08:33:23 d
|
||||
#ifdef IPFILTER_SYNC
|
||||
# if SOLARIS && defined(_KERNEL)
|
||||
extern struct pollhead iplpollhead[IPL_LOGSIZE];
|
||||
# endif
|
||||
# endif
|
||||
|
||||
ipfmutex_t ipf_syncadd, ipsl_mutex;
|
||||
ipfrwlock_t ipf_syncstate, ipf_syncnat;
|
||||
|
16
dist/ipf/lib/alist_new.c
vendored
16
dist/ipf/lib/alist_new.c
vendored
@ -1,22 +1,22 @@
|
||||
/* $NetBSD: alist_new.c,v 1.1.1.2 2008/05/20 06:45:00 darrenr Exp $ */
|
||||
/* $NetBSD: alist_new.c,v 1.1.1.3 2010/04/17 20:45:59 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: alist_new.c,v 1.1.2.3 2007/06/06 08:05:33 darrenr Exp
|
||||
* Id: alist_new.c,v 1.1.2.4 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
alist_t *
|
||||
alist_t *
|
||||
alist_new(int v, char *host)
|
||||
{
|
||||
int a, b, c, d, bits;
|
||||
char *slash;
|
||||
alist_t *al;
|
||||
u_int mask;
|
||||
char *slash;
|
||||
alist_t *al;
|
||||
u_int mask;
|
||||
|
||||
al = calloc(1, sizeof(*al));
|
||||
if (al == NULL) {
|
||||
@ -24,7 +24,7 @@ alist_new(int v, char *host)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bits = -1;
|
||||
bits = -1;
|
||||
slash = strchr(host, '/');
|
||||
if (slash != NULL) {
|
||||
*slash = '\0';
|
||||
@ -38,7 +38,7 @@ alist_new(int v, char *host)
|
||||
mask = 0xffffffff << (32 - bits);
|
||||
} else if (b == -1) {
|
||||
mask = 0xff000000;
|
||||
b = c = d = 0;
|
||||
b = c = d = 0;
|
||||
} else if (c == -1) {
|
||||
mask = 0xffff0000;
|
||||
c = d = 0;
|
||||
|
8
dist/ipf/lib/bcopywrap.c
vendored
8
dist/ipf/lib/bcopywrap.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: bcopywrap.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: bcopywrap.c,v 1.1.1.3 2010/04/17 20:45:57 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: bcopywrap.c,v 1.1.4.1 2006/06/16 17:20:56 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* Id: bcopywrap.c,v 1.1.4.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/gethost.c
vendored
12
dist/ipf/lib/gethost.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: gethost.c,v 1.1.1.3 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: gethost.c,v 1.1.1.4 2010/04/17 20:45:59 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002-2004 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: gethost.c,v 1.3.2.2 2006/06/16 17:20:59 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: gethost.c,v 1.3.2.3 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/getifname.c
vendored
12
dist/ipf/lib/getifname.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: getifname.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: getifname.c,v 1.1.1.3 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002-2004 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: getifname.c,v 1.5.2.3 2006/07/14 06:12:24 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: getifname.c,v 1.5.2.4 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/getsumd.c
vendored
12
dist/ipf/lib/getsumd.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: getsumd.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: getsumd.c,v 1.1.1.3 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: getsumd.c,v 1.2.4.1 2006/06/16 17:21:01 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: getsumd.c,v 1.2.4.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/kmemcpywrap.c
vendored
12
dist/ipf/lib/kmemcpywrap.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: kmemcpywrap.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: kmemcpywrap.c,v 1.1.1.3 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: kmemcpywrap.c,v 1.1.4.1 2006/06/16 17:21:05 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: kmemcpywrap.c,v 1.1.4.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
#include "kmem.h"
|
||||
|
12
dist/ipf/lib/kvatoname.c
vendored
12
dist/ipf/lib/kvatoname.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: kvatoname.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: kvatoname.c,v 1.1.1.3 2010/04/17 20:45:49 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: kvatoname.c,v 1.1.4.1 2006/06/16 17:21:05 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: kvatoname.c,v 1.1.4.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
10
dist/ipf/lib/load_file.c
vendored
10
dist/ipf/lib/load_file.c
vendored
@ -1,11 +1,11 @@
|
||||
/* $NetBSD: load_file.c,v 1.1.1.1 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: load_file.c,v 1.1.1.2 2010/04/17 20:45:58 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: load_file.c,v 1.1.2.1 2006/08/25 21:13:04 darrenr Exp
|
||||
* Id: load_file.c,v 1.1.2.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
@ -22,13 +22,13 @@ load_file(char *filename)
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "load_file cannot open '%s'\n", filename);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
a = NULL;
|
||||
rtop = NULL;
|
||||
rbot = NULL;
|
||||
linenum = 0;
|
||||
|
||||
linenum = 0;
|
||||
|
||||
while (fgets(line, sizeof(line) - 1, fp)) {
|
||||
line[sizeof(line) - 1] = '\0';
|
||||
linenum++;
|
||||
|
12
dist/ipf/lib/load_url.c
vendored
12
dist/ipf/lib/load_url.c
vendored
@ -1,11 +1,11 @@
|
||||
/* $NetBSD: load_url.c,v 1.1.1.1 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: load_url.c,v 1.1.1.2 2010/04/17 20:45:55 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: load_url.c,v 1.1.2.1 2006/08/25 21:13:04 darrenr Exp
|
||||
* Id: load_url.c,v 1.1.2.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
@ -15,11 +15,11 @@ load_url(char *url)
|
||||
{
|
||||
alist_t *hosts = NULL;
|
||||
|
||||
if (strncmp(url, "file://", 7) == 0) {
|
||||
/*
|
||||
if (strncmp(url, "file://", 7) == 0) {
|
||||
/*
|
||||
* file:///etc/passwd
|
||||
* ^------------s
|
||||
*/
|
||||
*/
|
||||
hosts = load_file(url);
|
||||
|
||||
} else if (*url == '/' || *url == '.') {
|
||||
@ -29,5 +29,5 @@ load_url(char *url)
|
||||
hosts = load_http(url);
|
||||
}
|
||||
|
||||
return hosts;
|
||||
return hosts;
|
||||
}
|
||||
|
12
dist/ipf/lib/mutex_emul.c
vendored
12
dist/ipf/lib/mutex_emul.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: mutex_emul.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: mutex_emul.c,v 1.1.1.3 2010/04/17 20:45:57 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2003 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: mutex_emul.c,v 1.2.4.1 2006/06/16 17:21:06 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: mutex_emul.c,v 1.2.4.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/nametokva.c
vendored
12
dist/ipf/lib/nametokva.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: nametokva.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: nametokva.c,v 1.1.1.3 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: nametokva.c,v 1.1.4.1 2006/06/16 17:21:07 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: nametokva.c,v 1.1.4.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/ntomask.c
vendored
12
dist/ipf/lib/ntomask.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: ntomask.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: ntomask.c,v 1.1.1.3 2010/04/17 20:45:58 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002-2005 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: ntomask.c,v 1.6.2.1 2006/06/16 17:21:07 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: ntomask.c,v 1.6.2.2 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
5
dist/ipf/lib/printfr.c
vendored
5
dist/ipf/lib/printfr.c
vendored
@ -1,11 +1,11 @@
|
||||
/* $NetBSD: printfr.c,v 1.1.1.8 2008/05/20 06:45:03 darrenr Exp $ */
|
||||
/* $NetBSD: printfr.c,v 1.1.1.9 2010/04/17 20:45:57 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000-2006 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printfr.c,v 1.43.2.20 2008/03/07 21:40:12 darrenr Exp
|
||||
* Id: printfr.c,v 1.43.2.21 2009/12/27 06:58:06 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
@ -443,7 +443,6 @@ ioctlfunc_t iocfunc;
|
||||
if (fp->fr_flags & FR_FRSTRICT)
|
||||
printf("strict");
|
||||
printf(")");
|
||||
|
||||
}
|
||||
}
|
||||
if (fp->fr_isc != (struct ipscan *)-1) {
|
||||
|
12
dist/ipf/lib/printhostmap.c
vendored
12
dist/ipf/lib/printhostmap.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: printhostmap.c,v 1.1.1.3 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: printhostmap.c,v 1.1.1.4 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002-2005 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printhostmap.c,v 1.3.2.3 2006/09/30 21:42:07 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printhostmap.c,v 1.3.2.4 2009/12/27 06:58:07 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/printpacket6.c
vendored
12
dist/ipf/lib/printpacket6.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: printpacket6.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: printpacket6.c,v 1.1.1.3 2010/04/17 20:45:57 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printpacket6.c,v 1.3.4.1 2006/06/16 17:21:13 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printpacket6.c,v 1.3.4.2 2009/12/27 06:58:07 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/printtunable.c
vendored
12
dist/ipf/lib/printtunable.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: printtunable.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: printtunable.c,v 1.1.1.3 2010/04/17 20:45:59 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2003 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printtunable.c,v 1.1.4.1 2006/06/16 17:21:15 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: printtunable.c,v 1.1.4.2 2009/12/27 06:58:07 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/resetlexer.c
vendored
12
dist/ipf/lib/resetlexer.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: resetlexer.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: resetlexer.c,v 1.1.1.3 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: resetlexer.c,v 1.1.4.1 2006/06/16 17:21:16 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: resetlexer.c,v 1.1.4.2 2009/12/27 06:58:07 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
12
dist/ipf/lib/rwlock_emul.c
vendored
12
dist/ipf/lib/rwlock_emul.c
vendored
@ -1,12 +1,12 @@
|
||||
/* $NetBSD: rwlock_emul.c,v 1.1.1.2 2007/04/14 20:17:31 martin Exp $ */
|
||||
/* $NetBSD: rwlock_emul.c,v 1.1.1.3 2010/04/17 20:45:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2003 by Darren Reed.
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: rwlock_emul.c,v 1.1.4.1 2006/06/16 17:21:17 darrenr Exp
|
||||
*/
|
||||
*
|
||||
* See the IPFILTER.LICENCE file for details on licencing.
|
||||
*
|
||||
* Id: rwlock_emul.c,v 1.1.4.2 2009/12/27 06:58:07 darrenr Exp
|
||||
*/
|
||||
|
||||
#include "ipf.h"
|
||||
|
||||
|
8
dist/ipf/tools/ipmon_y.y
vendored
8
dist/ipf/tools/ipmon_y.y
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipmon_y.y,v 1.1.1.3 2007/04/14 20:17:34 martin Exp $ */
|
||||
/* $NetBSD: ipmon_y.y,v 1.1.1.4 2010/04/17 20:45:06 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001-2004 by Darren Reed.
|
||||
@ -49,7 +49,7 @@ static ipmon_action_t *alist = NULL;
|
||||
%token <num> YY_NUMBER YY_HEX
|
||||
%token <str> YY_STR
|
||||
%token <ip6> YY_IPV6
|
||||
%token YY_COMMENT
|
||||
%token YY_COMMENT
|
||||
%token YY_CMP_EQ YY_CMP_NE YY_CMP_LE YY_CMP_GE YY_CMP_LT YY_CMP_GT
|
||||
%token YY_RANGE_OUT YY_RANGE_IN
|
||||
|
||||
@ -83,7 +83,7 @@ assign: YY_STR assigning YY_STR ';' { set_variable($1, $3);
|
||||
free($1);
|
||||
free($3);
|
||||
yyvarnext = 0;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
assigning:
|
||||
@ -375,7 +375,7 @@ opt_t *olist;
|
||||
a->ac_iface = o->o_str;
|
||||
o->o_str = NULL;
|
||||
break;
|
||||
case IPM_GROUP :
|
||||
case IPM_GROUP :
|
||||
if (o->o_str != NULL)
|
||||
strncpy(a->ac_group, o->o_str, FR_GROUPLEN);
|
||||
else
|
||||
|
7
dist/ipf/tools/ipnat.c
vendored
7
dist/ipf/tools/ipnat.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipnat.c,v 1.1.1.7 2009/08/19 08:29:55 darrenr Exp $ */
|
||||
/* $NetBSD: ipnat.c,v 1.1.1.8 2010/04/17 20:44:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001-2006 by Darren Reed.
|
||||
@ -67,7 +67,7 @@ extern char *sys_errlist[];
|
||||
|
||||
#if !defined(lint)
|
||||
static const char sccsid[] ="@(#)ipnat.c 1.9 6/5/96 (C) 1993 Darren Reed";
|
||||
static const char rcsid[] = "@(#)Id: ipnat.c,v 1.24.2.12 2008/11/06 21:18:20 darrenr Exp";
|
||||
static const char rcsid[] = "@(#)Id: ipnat.c,v 1.24.2.13 2009/12/27 06:58:06 darrenr Exp";
|
||||
#endif
|
||||
|
||||
|
||||
@ -189,7 +189,6 @@ char *argv[];
|
||||
if ((opts & OPT_DONOTHING) == 0) {
|
||||
if (checkrev(IPL_NAME) == -1) {
|
||||
fprintf(stderr, "User/kernel version check failed\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -577,6 +576,6 @@ int fd;
|
||||
obj.ipfo_type = IPFOBJ_STATETQTAB;
|
||||
|
||||
if (ioctl(fd, SIOCGTQTAB, &obj) == 0) {
|
||||
printtqtable(table);
|
||||
printtqtable(table);
|
||||
}
|
||||
}
|
||||
|
40
dist/ipf/tools/ipsyncm.c
vendored
40
dist/ipf/tools/ipsyncm.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipsyncm.c,v 1.1.1.5 2009/08/19 08:29:49 darrenr Exp $ */
|
||||
/* $NetBSD: ipsyncm.c,v 1.1.1.6 2010/04/17 20:45:02 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001-2006 by Darren Reed.
|
||||
@ -7,7 +7,7 @@
|
||||
*/
|
||||
#if !defined(lint)
|
||||
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
|
||||
static const char rcsid[] = "@(#)Id: ipsyncm.c,v 1.4.2.6 2009/03/29 01:17:53 darrenr Exp";
|
||||
static const char rcsid[] = "@(#)Id: ipsyncm.c,v 1.4.2.7 2009/12/27 06:58:06 darrenr Exp";
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
@ -49,7 +49,7 @@ static void handleterm(int sig)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* should be large enough to hold header + any datatype */
|
||||
#define BUFFERLEN 1400
|
||||
|
||||
@ -66,14 +66,14 @@ char *argv[];
|
||||
u_32_t magic;
|
||||
synchdr_t *sh;
|
||||
char *progname;
|
||||
|
||||
|
||||
progname = strrchr(argv[0], '/');
|
||||
if (progname) {
|
||||
progname++;
|
||||
} else {
|
||||
progname = argv[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
usage(progname);
|
||||
@ -108,13 +108,13 @@ char *argv[];
|
||||
syslog(LOG_ERR, "Opening %s :%m", IPSYNC_NAME);
|
||||
goto tryagain;
|
||||
}
|
||||
|
||||
|
||||
nfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (nfd == -1) {
|
||||
syslog(LOG_ERR, "Socket :%m");
|
||||
goto tryagain;
|
||||
}
|
||||
|
||||
|
||||
if (connect(nfd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
|
||||
syslog(LOG_ERR, "Connect: %m");
|
||||
goto tryagain;
|
||||
@ -122,15 +122,15 @@ char *argv[];
|
||||
|
||||
syslog(LOG_INFO, "Sending data to %s",
|
||||
inet_ntoa(sin.sin_addr));
|
||||
|
||||
inbuf = 0;
|
||||
|
||||
inbuf = 0;
|
||||
while (1) {
|
||||
|
||||
n1 = read(lfd, buff+inbuf, BUFFERLEN-inbuf);
|
||||
|
||||
|
||||
printf("header : %d bytes read (header = %d bytes)\n",
|
||||
n1, (int) sizeof(*sh));
|
||||
|
||||
|
||||
if (n1 < 0) {
|
||||
syslog(LOG_ERR, "Read error (header): %m");
|
||||
goto tryagain;
|
||||
@ -143,8 +143,8 @@ char *argv[];
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
inbuf += n1;
|
||||
|
||||
inbuf += n1;
|
||||
|
||||
moreinbuf:
|
||||
if (inbuf < sizeof(*sh)) {
|
||||
@ -153,7 +153,7 @@ moreinbuf:
|
||||
|
||||
sh = (synchdr_t *)buff;
|
||||
len = ntohl(sh->sm_len);
|
||||
magic = ntohl(sh->sm_magic);
|
||||
magic = ntohl(sh->sm_magic);
|
||||
|
||||
if (magic != SYNHDRMAGIC) {
|
||||
syslog(LOG_ERR,
|
||||
@ -181,8 +181,8 @@ moreinbuf:
|
||||
printf(" table:Unknown(%d)", sh->sm_table);
|
||||
|
||||
printf(" num:%d\n", (u_32_t)ntohl(sh->sm_num));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
if (inbuf < sizeof(*sh) + len) {
|
||||
continue; /* need more data */
|
||||
goto tryagain;
|
||||
@ -195,9 +195,9 @@ moreinbuf:
|
||||
} else if (sh->sm_cmd == SMC_UPDATE) {
|
||||
su = (syncupdent_t *)buff;
|
||||
if (sh->sm_p == IPPROTO_TCP) {
|
||||
printf(" TCP Update: age %lu state %d/%d\n",
|
||||
printf(" TCP Update: age %lu state %d/%d\n",
|
||||
su->sup_tcp.stu_age,
|
||||
su->sup_tcp.stu_state[0],
|
||||
su->sup_tcp.stu_state[0],
|
||||
su->sup_tcp.stu_state[1]);
|
||||
}
|
||||
} else {
|
||||
@ -212,7 +212,7 @@ moreinbuf:
|
||||
goto tryagain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (n3 != n2) {
|
||||
syslog(LOG_ERR, "Incomplete write (%d/%d)",
|
||||
n3, n2);
|
||||
@ -226,7 +226,7 @@ moreinbuf:
|
||||
/* move buffer to the front,we might need to make
|
||||
* this more efficient, by using a rolling pointer
|
||||
* over the buffer and only copying it, when
|
||||
* we are reaching the end
|
||||
* we are reaching the end
|
||||
*/
|
||||
inbuf -= n2;
|
||||
if (inbuf) {
|
||||
|
45
dist/ipf/tools/ipsyncs.c
vendored
45
dist/ipf/tools/ipsyncs.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipsyncs.c,v 1.1.1.5 2009/08/19 08:29:53 darrenr Exp $ */
|
||||
/* $NetBSD: ipsyncs.c,v 1.1.1.6 2010/04/17 20:44:56 darrenr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001-2006 by Darren Reed.
|
||||
@ -7,7 +7,7 @@
|
||||
*/
|
||||
#if !defined(lint)
|
||||
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
|
||||
static const char rcsid[] = "@(#)Id: ipsyncs.c,v 1.5.2.5 2009/03/29 01:17:53 darrenr Exp";
|
||||
static const char rcsid[] = "@(#)Id: ipsyncs.c,v 1.5.2.6 2009/12/27 06:58:06 darrenr Exp";
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
@ -57,7 +57,7 @@ int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int nfd = -1 , lfd = -1;
|
||||
int nfd = -1 , lfd = -1;
|
||||
int n1, n2, n3, magic, len, inbuf;
|
||||
struct sockaddr_in sin;
|
||||
struct sockaddr_in in;
|
||||
@ -66,14 +66,14 @@ char *argv[];
|
||||
syncupdent_t *su;
|
||||
synchdr_t *sh;
|
||||
char *progname;
|
||||
|
||||
|
||||
progname = strrchr(argv[0], '/');
|
||||
if (progname) {
|
||||
progname++;
|
||||
} else {
|
||||
progname = argv[0];
|
||||
}
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
usage(progname);
|
||||
exit(1);
|
||||
@ -86,7 +86,7 @@ char *argv[];
|
||||
#endif
|
||||
|
||||
openlog(progname, LOG_PID, LOG_SECURITY);
|
||||
|
||||
|
||||
lfd = open(IPSYNC_NAME, O_WRONLY);
|
||||
if (lfd == -1) {
|
||||
syslog(LOG_ERR, "Opening %s :%m", IPSYNC_NAME);
|
||||
@ -101,14 +101,13 @@ char *argv[];
|
||||
sin.sin_port = htons(atoi(argv[2]));
|
||||
else
|
||||
sin.sin_port = htons(43434);
|
||||
if (argc > 3)
|
||||
if (argc > 3)
|
||||
in.sin_addr.s_addr = inet_addr(argv[3]);
|
||||
else
|
||||
in.sin_addr.s_addr = 0;
|
||||
in.sin_port = 0;
|
||||
|
||||
while(1) {
|
||||
|
||||
if (lfd != -1)
|
||||
close(lfd);
|
||||
if (nfd != -1)
|
||||
@ -119,7 +118,7 @@ char *argv[];
|
||||
syslog(LOG_ERR, "Opening %s :%m", IPSYNC_NAME);
|
||||
goto tryagain;
|
||||
}
|
||||
|
||||
|
||||
nfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (nfd == -1) {
|
||||
syslog(LOG_ERR, "Socket :%m");
|
||||
@ -135,20 +134,20 @@ char *argv[];
|
||||
}
|
||||
|
||||
syslog(LOG_INFO, "Listening to %s", inet_ntoa(sin.sin_addr));
|
||||
|
||||
inbuf = 0;
|
||||
|
||||
inbuf = 0;
|
||||
while (1) {
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* XXX currently we do not check the source address
|
||||
* of a datagram, this can be a security risk
|
||||
*/
|
||||
n1 = read(nfd, buff+inbuf, BUFFERLEN-inbuf);
|
||||
|
||||
|
||||
printf("header : %d bytes read (header = %d bytes)\n",
|
||||
n1, (int) sizeof(*sh));
|
||||
|
||||
|
||||
if (n1 < 0) {
|
||||
syslog(LOG_ERR, "Read error (header): %m");
|
||||
goto tryagain;
|
||||
@ -161,8 +160,8 @@ char *argv[];
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
inbuf += n1;
|
||||
|
||||
inbuf += n1;
|
||||
|
||||
moreinbuf:
|
||||
if (inbuf < sizeof(*sh)) {
|
||||
@ -171,7 +170,7 @@ moreinbuf:
|
||||
|
||||
sh = (synchdr_t *)buff;
|
||||
len = ntohl(sh->sm_len);
|
||||
magic = ntohl(sh->sm_magic);
|
||||
magic = ntohl(sh->sm_magic);
|
||||
|
||||
if (magic != SYNHDRMAGIC) {
|
||||
syslog(LOG_ERR, "Invalid header magic %x",
|
||||
@ -199,8 +198,8 @@ moreinbuf:
|
||||
printf(" table:Unknown(%d)", sh->sm_table);
|
||||
|
||||
printf(" num:%d\n", (u_32_t)ntohl(sh->sm_num));
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
if (inbuf < sizeof(*sh) + len) {
|
||||
continue; /* need more data */
|
||||
goto tryagain;
|
||||
@ -213,9 +212,9 @@ moreinbuf:
|
||||
} else if (sh->sm_cmd == SMC_UPDATE) {
|
||||
su = (syncupdent_t *)buff;
|
||||
if (sh->sm_p == IPPROTO_TCP) {
|
||||
printf(" TCP Update: age %lu state %d/%d\n",
|
||||
printf(" TCP Update: age %lu state %d/%d\n",
|
||||
su->sup_tcp.stu_age,
|
||||
su->sup_tcp.stu_state[0],
|
||||
su->sup_tcp.stu_state[0],
|
||||
su->sup_tcp.stu_state[1]);
|
||||
}
|
||||
} else {
|
||||
@ -231,7 +230,7 @@ moreinbuf:
|
||||
goto tryagain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (n3 != n2) {
|
||||
syslog(LOG_ERR, "%s: Incomplete write (%d/%d)",
|
||||
IPSYNC_NAME, n3, n2);
|
||||
@ -245,7 +244,7 @@ moreinbuf:
|
||||
/* move buffer to the front,we might need to make
|
||||
* this more efficient, by using a rolling pointer
|
||||
* over the buffer and only copying it, when
|
||||
* we are reaching the end
|
||||
* we are reaching the end
|
||||
*/
|
||||
inbuf -= n2;
|
||||
if (inbuf) {
|
||||
|
Loading…
Reference in New Issue
Block a user