aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2019-04-29 09:52:53 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2019-04-29 09:52:53 +0000
commit761618de05f9a6bab9b56326746512d8fe1a9511 (patch)
tree249e74b62b413b1c65dd629c1fd1724f08431aa0 /sbin/ipfw
parent90ecb41fba40d834371b28b6163b6651155bceb1 (diff)
downloadsrc-761618de05f9a6bab9b56326746512d8fe1a9511.tar.gz
src-761618de05f9a6bab9b56326746512d8fe1a9511.zip
Handle HAVE_PROTO flag and print "proto" keyword for O_IP4 and O_IP6
opcodes when it is needed. This should fix the problem, when printed by `ipfw show` rule could not be added due to missing "proto" keyword. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=346885
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index c57b4b6f6a1e..3e73fa3b8736 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -1701,9 +1701,13 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo,
IPFW_TLV_STATE_NAME));
break;
case O_IP6:
+ if (state->flags & HAVE_PROTO)
+ bprintf(bp, " proto");
bprintf(bp, " ip6");
break;
case O_IP4:
+ if (state->flags & HAVE_PROTO)
+ bprintf(bp, " proto");
bprintf(bp, " ip4");
break;
case O_ICMP6TYPE: