svn commit: r359699 - stable/12/libexec/rc/rc.d

Eugene Grosbein eugen at FreeBSD.org
Tue Apr 7 16:52:46 UTC 2020


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


More information about the svn-src-all mailing list