From nobody@FreeBSD.org  Tue Nov 15 17:09:03 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0A16516A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Nov 2005 17:09:03 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 686FC43D5A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Nov 2005 17:08:58 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jAFH8vvv080658
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Nov 2005 17:08:57 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id jAFH8vLP080657;
	Tue, 15 Nov 2005 17:08:57 GMT
	(envelope-from nobody)
Message-Id: <200511151708.jAFH8vLP080657@www.freebsd.org>
Date: Tue, 15 Nov 2005 17:08:57 GMT
From: Vladimir Kotal <vlada@devnull.cz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pfctl does not check interface name against list of known interfaces with () operator
X-Send-Pr-Version: www-2.3

>Number:         89079
>Category:       bin
>Synopsis:       pfctl(8) does not check interface name against list of known interfaces with () operator
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-pf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 15 17:10:20 GMT 2005
>Closed-Date:    Wed Nov 16 07:55:45 GMT 2005
>Last-Modified:  Wed Nov 16 07:55:45 GMT 2005
>Originator:     Vladimir Kotal
>Release:        5.4-RELEASE
>Organization:
>Environment:
FreeBSD worm 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May  8 10:21:06 UTC 2005     root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
pfctl(8) does not check interface name against list of interfaces
actually present.
>How-To-Repeat:
insert following line into valid pf.conf file:

  pass out quick on $ext_if proto icmp from (XXX) to any keep state

where ext_if is name of arbitrary interface in the system and load the
config file via pfctl -f <file>.

when loaded, pfctl -s Interfaces would present list of valid interfaces
along with 'XXX' "interface".

the problem lies in pfctl_parser.c:ifa_exists()

and in following parse.y code:

                        if (ifa_exists($2, 1) == NULL && strcmp($2, "self")) {
#ifndef __FreeBSD__
                                yyerror("interface %s does not exist", $2);
                                free(op);
                                YYERROR;
#endif

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-pf 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Nov 16 05:57:18 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=89079 
State-Changed-From-To: open->closed 
State-Changed-By: mlaier 
State-Changed-When: Wed Nov 16 07:53:00 GMT 2005 
State-Changed-Why:  
This is not a bug.  One needs this behaviour in order to write rules for 
not-yet existing interfaces.  e.g. loading rules *before* bringing up pppd(8) 
and thus tun0. 

Can you please take such problems to the freebsd-pf@ mailing list first. 

Thanks. 

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