add_proto() now fills proto for us so stop to 'guess' the protocol from the

command and rather trust the value add_proto filled in.  While here, fix an
oversight in the pretty printing of ip6/4 options.
This commit is contained in:
Max Laier 2005-06-07 14:11:17 +00:00
parent f4b580b1dd
commit b730879ffa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147105

View File

@ -1575,7 +1575,7 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
case O_IP6_SRC:
case O_IP6_SRC_MASK:
case O_IP6_SRC_ME:
show_prerequisites(&flags, HAVE_PROTO6, 0);
show_prerequisites(&flags, HAVE_PROTO, 0);
if (!(flags & HAVE_SRCIP))
printf(" from");
if ((cmd->len & F_OR) && !or_block)
@ -3991,10 +3991,7 @@ add(int ac, char *av[])
NEED1("missing protocol");
if (add_proto(cmd, *av, &proto)) {
av++; ac--;
if (F_LEN(cmd) == 0) /* plain IP */
proto = 0;
else {
proto = cmd->arg1;
if (F_LEN(cmd) != 0) {
prev = cmd;
cmd = next_cmd(cmd);
}