summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-12-05 02:43:26 +0000
committerjulian <julian@FreeBSD.org>1997-12-05 02:43:26 +0000
commite434f4878b7eb28e5b853f621ed9db40f4229be2 (patch)
tree97ad3b2fff0f1d5761dae06bfcc551a957a00138 /sbin/ipfw
parent630123988385741ea95897b1d2533c27c6fee534 (diff)
downloadFreeBSD-src-e434f4878b7eb28e5b853f621ed9db40f4229be2.zip
FreeBSD-src-e434f4878b7eb28e5b853f621ed9db40f4229be2.tar.gz
Allow ipfw to accept comments and blank lines.
This makes ipfw config files a LOT more readable.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw.82
-rw-r--r--sbin/ipfw/ipfw.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 355676f..c4535c5 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -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
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c
index fb4f577..8213a74 100644
--- a/sbin/ipfw/ipfw.c
+++ b/sbin/ipfw/ipfw.c
@@ -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;
OpenPOWER on IntegriCloud