From b055e3be51d83aaa5929d95a218bc86aea36a1ef Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Mon, 8 Aug 2016 18:30:50 +0000 Subject: [PATCH] Fix formatting of setfib opcode. Zero fib is correct value and it conflicts with IP_FW_TARG. Use bprint_uint_arg() only when opcode contains IP_FW_TARG, otherwise just print numeric value with cleared high-order bit. MFC after: 3 days --- sbin/ipfw/ipfw2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 1a38076d7bc9..a02ce39cf3fd 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -1590,8 +1590,11 @@ show_static_rule(struct cmdline_opts *co, struct format_opts *fo, break; case O_SETFIB: - bprint_uint_arg(bp, "setfib ", cmd->arg1 & 0x7FFF); - break; + if (cmd->arg1 == IP_FW_TARG) + bprint_uint_arg(bp, "setfib ", cmd->arg1); + else + bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF); + break; case O_EXTERNAL_ACTION: { /*