Allow ipfw to accept comments and blank lines.
This makes ipfw config files a LOT more readable.
This commit is contained in:
parent
6210388a93
commit
c7a0bf0440
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31547
@ -84,6 +84,8 @@ The zero operation zeroes the counters associated with rule number
|
||||
.Pp
|
||||
The flush operation removes all rules.
|
||||
.Pp
|
||||
Any command beginning with a '#', or being all blank, is ignored.
|
||||
.Pp
|
||||
One rule is always present:
|
||||
.Bd -literal -offset center
|
||||
65535 deny all from any to any
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* NEW command line interface for IP firewall facility
|
||||
*
|
||||
* $Id: ipfw.c,v 1.46 1997/07/25 03:13:46 brian Exp $
|
||||
* $Id: ipfw.c,v 1.47 1997/08/08 14:36:28 alex Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -1200,9 +1200,13 @@ main(ac, av)
|
||||
sprintf(linename, "Line %d", lineno);
|
||||
args[0] = linename;
|
||||
|
||||
if (*buf == '#')
|
||||
continue;
|
||||
for (i = 1, a = strtok(buf, WHITESP);
|
||||
a && i < MAX_ARGS; a = strtok(NULL, WHITESP), i++)
|
||||
args[i] = a;
|
||||
if (i == 1)
|
||||
continue;
|
||||
if (i == MAX_ARGS)
|
||||
errx(1, "%s: too many arguments", linename);
|
||||
args[i] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user