From nobody@FreeBSD.org  Fri Oct 10 16:39:24 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B94741065697
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Oct 2008 16:39:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id AA2918FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Oct 2008 16:39:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9AGdNjl086396
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Oct 2008 16:39:23 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id m9AGdN2c086395;
	Fri, 10 Oct 2008 16:39:23 GMT
	(envelope-from nobody)
Message-Id: <200810101639.m9AGdN2c086395@www.freebsd.org>
Date: Fri, 10 Oct 2008 16:39:23 GMT
From: Josh Carroll <josh.carroll@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /etc/rc.d/pf should REQUIRE ppp
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         128005
>Category:       conf
>Synopsis:       /etc/rc.d/pf should REQUIRE ppp
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 10 16:40:01 UTC 2008
>Closed-Date:    Fri Oct 10 19:35:38 UTC 2008
>Last-Modified:  Fri Oct 10 19:35:38 UTC 2008
>Originator:     Josh Carroll
>Release:        7.1-PRERELEASE/amd64
>Organization:
N/A
>Environment:
FreeBSD pflog.net 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #1: Fri Oct  3 20:58:17 EDT 2008     root@pflog.net:/usr/obj/usr/src/sys/PFLOG  amd64
>Description:
I have not personally experienced this problem, but I am submitting on behalf of the person who experienced the problem.

This user is using diald/ppp to establish a PPPoE connection, which is brought up on tun0.

/etc/rc.d/pf happens before /etc/rc.d/ppp according to rcorder, so tun0 does not yet have an IP address and pf fails to load the ruleset.

This is already done for ipfw, so I guess it makes sense to do it also for pf:

% rcorder /etc/rc.d/* | grep -E '(netif|ppp|pf)'
/etc/rc.d/ipfilter
/etc/rc.d/ipfs
/etc/rc.d/sppp
/etc/rc.d/netif
/etc/rc.d/pfsync
/etc/rc.d/pflog
/etc/rc.d/pf
/etc/rc.d/ppp
/etc/rc.d/ipfw
/etc/rc.d/pppoed
/etc/rc.d/rfcomm_pppd_server

Putting ppp as a REQUIRE for pf fixed this person's particular problem. I'm just not aware if there was a reason for not having this in place, historically speaking.

Thanks!
Josh


>How-To-Repeat:
Setup ppp/diald for tun0 and have a pf.conf referencing the tun0 interface.
>Fix:
--- pf.old      2008-10-10 12:37:47.000000000 -0400
+++ pf  2008-10-10 12:37:52.000000000 -0400
@@ -4,7 +4,7 @@
 #

 # PROVIDE: pf
-# REQUIRE: FILESYSTEMS netif pflog pfsync
+# REQUIRE: FILESYSTEMS netif pflog pfsync ppp
 # BEFORE:  routing
 # KEYWORD: nojail


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Fri Oct 10 19:35:37 UTC 2008 
State-Changed-Why:  
This had been discussed before and will not be incorporated. You can do 
that manually if needed and you can use cloned_interfaces to setup tun0 
in advance. Reason for this being loaded as soon as possible, is that 
the network stack is protected, if you do it differently there is a 
window of opportunity to break in. So you can do that locally if needed, 
but it will not get incorporated into the tree. This is a summary of 
what had been discussed before. Thanks for taking the time to submit 
this and for using FreeBSD! 

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