diff options
author | mlaier <mlaier@FreeBSD.org> | 2005-06-07 14:11:17 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2005-06-07 14:11:17 +0000 |
commit | 163c101c2cf347c70a3fe18f9acab4779cd2484b (patch) | |
tree | 2223945cf8ad0dcd9db237df513a1cedd6ec3356 /sbin/ipfw | |
parent | a7f80c758fc4107a4d5e0bfa73876e079716de7e (diff) | |
download | FreeBSD-src-163c101c2cf347c70a3fe18f9acab4779cd2484b.zip FreeBSD-src-163c101c2cf347c70a3fe18f9acab4779cd2484b.tar.gz |
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.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index c645e0b..686174d 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -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); } |