1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-20 02:38:43 +00:00

Make sure that comments are printed at the end of a rule.

Reported by:  Patrick Tracanelli <eksffa@freebsdbrasil.com.br>
This commit is contained in:
Luigi Rizzo 2003-07-15 10:23:43 +00:00
parent e6b34a1dbb
commit bbc39c8391
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117626

View File

@ -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");
}