Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2019 09:52:54 +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: r346885 - head/sbin/ipfw
Message-ID:  <201904290952.x3T9qsTG072036@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Apr 29 09:52:53 2019
New Revision: 346885
URL: https://svnweb.freebsd.org/changeset/base/346885

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

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Mon Apr 29 09:33:16 2019	(r346884)
+++ head/sbin/ipfw/ipfw2.c	Mon Apr 29 09:52:53 2019	(r346885)
@@ -1701,9 +1701,13 @@ print_instruction(struct buf_pr *bp, const struct form
 		    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:



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