Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Aug 2016 18:30:50 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303845 - head/sbin/ipfw
Message-ID:  <201608081830.u78IUowZ003861@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Aug  8 18:30:50 2016
New Revision: 303845
URL: https://svnweb.freebsd.org/changeset/base/303845

Log:
  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

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Mon Aug  8 18:13:03 2016	(r303844)
+++ head/sbin/ipfw/ipfw2.c	Mon Aug  8 18:30:50 2016	(r303845)
@@ -1590,8 +1590,11 @@ show_static_rule(struct cmdline_opts *co
 			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: {
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608081830.u78IUowZ003861>