diff options
author | luigi <luigi@FreeBSD.org> | 2003-07-15 10:23:43 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2003-07-15 10:23:43 +0000 |
commit | ce0c00f511371de4e08ccd40a89f1d4d6b8f7912 (patch) | |
tree | 346e6a472fee89c8df3e7dd5c17a400bdda4056d /sbin | |
parent | 0bdfbc1a71328cd3b8d77a7fcc5e08435e743403 (diff) | |
download | FreeBSD-src-ce0c00f511371de4e08ccd40a89f1d4d6b8f7912.zip FreeBSD-src-ce0c00f511371de4e08ccd40a89f1d4d6b8f7912.tar.gz |
Make sure that comments are printed at the end of a rule.
Reported by: Patrick Tracanelli <eksffa@freebsdbrasil.com.br>
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index a2e1f9d..91761bc 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -881,6 +881,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) static int twidth = 0; int l; ipfw_insn *cmd; + char *comment = NULL; /* ptr to comment if we have one */ int proto = 0; /* default */ int flags = 0; /* prerequisites */ ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */ @@ -1263,7 +1264,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) break; case O_NOP: - printf(" // %s", (char *)(cmd + 1)); + comment = (char *)(cmd + 1); break; case O_KEEP_STATE: @@ -1302,7 +1303,8 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth) } } show_prerequisites(&flags, HAVE_IP, 0); - + if (comment) + printf(" // %s", comment); printf("\n"); } |