diff options
author | Darren Reed <darrenr@FreeBSD.org> | 2003-02-15 06:27:40 +0000 |
---|---|---|
committer | Darren Reed <darrenr@FreeBSD.org> | 2003-02-15 06:27:40 +0000 |
commit | 965575f97c41ba491915667faac038cb6d3a850e (patch) | |
tree | 29f4be4986706d6bd410350a9d79520c171b297f /contrib/ipfilter/ipf.c | |
parent | f7a96e18f16f15c9ffeff1ab041faeb5584c7fb3 (diff) | |
download | src-965575f97c41ba491915667faac038cb6d3a850e.tar.gz src-965575f97c41ba491915667faac038cb6d3a850e.zip |
Import userland tools for IPFilter 3.4.31 into -current
Notes
Notes:
svn path=/vendor/ipfilter/dist/; revision=110917
Diffstat (limited to 'contrib/ipfilter/ipf.c')
-rw-r--r-- | contrib/ipfilter/ipf.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/contrib/ipfilter/ipf.c b/contrib/ipfilter/ipf.c index b22addf0d5ff..b6a60c7469e0 100644 --- a/contrib/ipfilter/ipf.c +++ b/contrib/ipfilter/ipf.c @@ -12,7 +12,7 @@ # endif # endif #endif -#ifdef __sgi +#if defined(__sgi) && (IRIX > 602) # include <sys/ptimers.h> #endif #include <stdio.h> @@ -50,7 +50,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)ipf.c 1.23 6/5/96 (C) 1993-2000 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ipf.c,v 2.10.2.17 2002/06/27 14:29:17 darrenr Exp $"; +static const char rcsid[] = "@(#)$Id: ipf.c,v 2.10.2.19 2002/12/06 11:41:13 darrenr Exp $"; #endif #if SOLARIS @@ -440,9 +440,15 @@ char *arg; rem = fl; closedevice(); - if (opendevice(IPL_STATE) != -2 && - ioctl(fd, SIOCIPFFL, &fl) == -1) - perror("ioctl(SIOCIPFFL)"); + if (opendevice(IPL_STATE) != -2) { + if (use_inet6) { + if (ioctl(fd, SIOCIPFL6, &fl) == -1) + perror("ioctl(SIOCIPFL6)"); + } else { + if (ioctl(fd, SIOCIPFFL, &fl) == -1) + perror("ioctl(SIOCIPFFL)"); + } + } if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) { printf("remove flags %s (%d)\n", arg, rem); printf("removed %d filter rules\n", fl); @@ -459,8 +465,15 @@ char *arg; fl |= (opts & FR_INACTIVE); rem = fl; - if (opendevice(ipfname) != -2 && ioctl(fd, SIOCIPFFL, &fl) == -1) - perror("ioctl(SIOCIPFFL)"); + if (opendevice(ipfname) != -2) { + if (use_inet6) { + if (ioctl(fd, SIOCIPFL6, &fl) == -1) + perror("ioctl(SIOCIPFL6)"); + } else { + if (ioctl(fd, SIOCIPFFL, &fl) == -1) + perror("ioctl(SIOCIPFFL)"); + } + } if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) { printf("remove flags %s%s (%d)\n", (rem & FR_INQUE) ? "I" : "", (rem & FR_OUTQUE) ? "O" : "", rem); |