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
This commit is contained in:
Andrey V. Elsukov
2019-04-29 09:52:53 +00:00
parent 90ecb41fba
commit 761618de05
+4
View File
@@ -1701,9 +1701,13 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo,
IPFW_TLV_STATE_NAME)); IPFW_TLV_STATE_NAME));
break; break;
case O_IP6: case O_IP6:
if (state->flags & HAVE_PROTO)
bprintf(bp, " proto");
bprintf(bp, " ip6"); bprintf(bp, " ip6");
break; break;
case O_IP4: case O_IP4:
if (state->flags & HAVE_PROTO)
bprintf(bp, " proto");
bprintf(bp, " ip4"); bprintf(bp, " ip4");
break; break;
case O_ICMP6TYPE: case O_ICMP6TYPE: