svn commit: r303845 - head/sbin/ipfw

Andrey V. Elsukov ae at FreeBSD.org
Mon Aug 8 18:30:51 UTC 2016


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: {
 			/*


More information about the svn-src-all mailing list