Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Apr 2020 16:52:45 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r359699 - stable/12/libexec/rc/rc.d
Message-ID:  <202004071652.037GqjMF059808@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Tue Apr  7 16:52:45 2020
New Revision: 359699
URL: https://svnweb.freebsd.org/changeset/base/359699

Log:
  MFC r356943,356944: Correct "service ipfw status" for INET6-only systems.

Modified:
  stable/12/libexec/rc/rc.d/ipfw
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rc/rc.d/ipfw
==============================================================================
--- stable/12/libexec/rc/rc.d/ipfw	Tue Apr  7 16:47:35 2020	(r359698)
+++ stable/12/libexec/rc/rc.d/ipfw	Tue Apr  7 16:52:45 2020	(r359699)
@@ -127,7 +127,11 @@ ipfw_stop()
 ipfw_status()
 {
 	status=$(sysctl -i -n net.inet.ip.fw.enable)
-	if [ ${status:-0} -eq 0 ]; then
+	: ${status:=0}
+	if afexists inet6; then
+		status=$((${status} + $(sysctl -i -n net.inet6.ip6.fw.enable)))
+	fi
+	if [ ${status} -eq 0 ]; then
 		echo "ipfw is not enabled"
 		exit 1
 	else



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