From wumpus@peterlink.ru  Fri Aug 29 09:38:24 2003
Return-Path: <wumpus@peterlink.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4EEBF16A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 2003 09:38:24 -0700 (PDT)
Received: from holmes.peterlink.ru (holmes.peterlink.ru [195.242.2.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C7BBB43F75
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 2003 09:38:21 -0700 (PDT)
	(envelope-from wumpus@peterlink.ru)
Received: from stapleton.peterlink.ru (stapleton.peterlink.ru [195.242.2.5])
	by holmes.peterlink.ru (8.12.6/8.12.6) with ESMTP id h7TGcK3U068654
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 2003 20:38:20 +0400 (MSD)
Received: from xyzzy.zzz.net (spb-2-13.dialup.peterlink.ru [195.242.17.13])
	by stapleton.peterlink.ru (8.12.3/8.12.3) with ESMTP id h7TGbbZT042119
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 2003 20:37:38 +0400 (MSD)
Received: from xyzzy.zzz.net (localhost [127.0.0.1])
	by xyzzy.zzz.net (8.12.9/8.12.9) with ESMTP id h7TGbV0w002168
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 2003 20:37:31 +0400 (MSD)
	(envelope-from dg@xyzzy.zzz.net)
Received: (from dg@localhost)
	by xyzzy.zzz.net (8.12.9/8.12.9/Submit) id h7TGbVow002167;
	Fri, 29 Aug 2003 20:37:31 +0400 (MSD)
	(envelope-from dg)
Message-Id: <200308291637.h7TGbVow002167@xyzzy.zzz.net>
Date: Fri, 29 Aug 2003 20:37:31 +0400 (MSD)
From: Dmitri Goutnik <wumpus@peterlink.ru>
Reply-To: Dmitri Goutnik <wumpus@peterlink.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] /etc/rc.d/ipmon, /etc/rc.d/ipfilter fixes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56144
>Category:       conf
>Synopsis:       [PATCH] /etc/rc.d/ipmon, /etc/rc.d/ipfilter fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 29 09:40:05 PDT 2003
>Closed-Date:    Sun Jun 19 17:44:34 GMT 2005
>Last-Modified:  Sun Jun 19 17:44:34 GMT 2005
>Originator:     Dmitri Goutnik
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD xyzzy.zzz.net 5.1-CURRENT FreeBSD 5.1-CURRENT #9: Fri Aug 29 13:54:56 MSD 2003 root@xyzzy.zzz.net:/usr/obj/usr/src/sys/XYZZY i386


>Description:
	1). /etc/rc.d/ipmon is configured to run before /etc/rc.d/ipfilter and
	ipmon(8) fails to start when ipfilter was built as KLD module;

	2). /etc/rc.d/ipfilter always calls /sbin/ipf -E, this produces a
	bunch of "IP Filter: already initialized" when the kernel has ipfilter
	statically linked in;


>How-To-Repeat:
	Boot.

>Fix:

--- ipmon.path begins here ---
--- old/ipmon	Fri Aug 29 15:10:44 2003
+++ ipmon	Fri Aug 29 15:10:53 2003
@@ -5,7 +5,7 @@
 #
 
 # PROVIDE: ipmon
-# REQUIRE: mountcritlocal hostname sysctl cleanvar
+# REQUIRE: mountcritlocal hostname sysctl cleanvar ipfilter
 # BEFORE:  SERVERS
 # KEYWORD: FreeBSD NetBSD
 
--- ipmon.path ends here ---

--- ipfilter.path begins here ---
--- old/ipfilter	Fri Aug 29 12:04:18 2003
+++ ipfilter	Fri Aug 29 15:19:03 2003
@@ -5,7 +5,7 @@
 #
 
 # PROVIDE: ipfilter
-# REQUIRE: root beforenetlkm mountcritlocal ipmon
+# REQUIRE: root beforenetlkm mountcritlocal
 # BEFORE:  netif
 # KEYWORD: FreeBSD NetBSD
 
@@ -79,12 +79,15 @@
 	echo "Enabling ipfilter."
 	case ${OSTYPE} in
 	FreeBSD)
-		${ipfilter_program:-/sbin/ipf} -EFa
+		if [ `sysctl -n net.inet.ipf.fr_running` = "0" ]; then
+			${ipfilter_program:-/sbin/ipf} -E
+		fi
+		${ipfilter_program:-/sbin/ipf} -Fa
 		if [ -r "${ipfilter_rules}" ]; then
 			${ipfilter_program:-/sbin/ipf} \
 			    -f "${ipfilter_rules}" ${ipfilter_flags}
 		fi
-		${ipfilter_program:-/sbin/ipf} -6 -EFa
+		${ipfilter_program:-/sbin/ipf} -6 -Fa
 		if [ -r "${ipv6_ipfilter_rules}" ]; then
 			${ipfilter_program:-/sbin/ipf} -6 \
 			    -f "${ipv6_ipfilter_rules}" ${ipfilter_flags}
--- ipfilter.path ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: arved 
Responsible-Changed-When: Mon Aug 30 17:11:32 GMT 2004 
Responsible-Changed-Why:  
The first part of this PR has been committed some time ago, 
but maybe we want the second part too. Over to freebsd-rc vfor review  

http://www.freebsd.org/cgi/query-pr.cgi?pr=56144 
State-Changed-From-To: open->closed 
State-Changed-By: matteo 
State-Changed-When: Sun Jun 19 17:44:06 GMT 2005 
State-Changed-Why:  
second part of the PR was fixed too 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56144 
>Unformatted:
