From nobody@FreeBSD.org  Mon Sep  3 12:19:28 2007
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 E38AB16A547
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Sep 2007 12:19:28 +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 CD98913C45B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Sep 2007 12:19:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l83CJSx8042562
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Sep 2007 12:19:28 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l83CJS27042561;
	Mon, 3 Sep 2007 12:19:28 GMT
	(envelope-from nobody)
Message-Id: <200709031219.l83CJS27042561@www.freebsd.org>
Date: Mon, 3 Sep 2007 12:19:28 GMT
From: Andrey Sverdlichenko <blaze@ruddy.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Different anchor wildcards in pfctl and kernel
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         116048
>Category:       kern
>Synopsis:       [pf]: Different anchor wildcards in pfctl and kernel
>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:   Mon Sep 03 12:20:01 GMT 2007
>Closed-Date:    Mon Sep 03 13:29:45 GMT 2007
>Last-Modified:  Mon Sep 03 13:29:45 GMT 2007
>Originator:     Andrey Sverdlichenko
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD bsd62.infosec.ru 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007     root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
pfctl expects :* as anchor wildcard.
pf_ioctl.c expects /* as anchor windcard.

As the result, anchor wildcards do not work at all.
>How-To-Repeat:
Create anchor foo with several sub-anchors and add "anchor foo:*" rule to main ruleset. No packets passed to sub-anchors.
Also you have "syntax error" when trying "anchor foo/*" command.
>Fix:
==== //sys/contrib/pf/net/pf_ioctl.c#3 - sys/contrib/pf/net/pf_ioctl.c ====
@@ -713,7 +713,7 @@
 		strlcat(path, name, sizeof(path));
 	}
 #ifdef __FreeBSD__
-	if ((p = rindex(path, '/')) != NULL && !strcmp(p, "/*")) {
+	if ((p = rindex(path, ':')) != NULL && !strcmp(p, ":*")) {
 #else
 	if ((p = strrchr(path, '/')) != NULL && !strcmp(p, "/*")) {
 #endif


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-pf 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Sep 3 12:50:13 UTC 2007 
Responsible-Changed-Why:  
redirect to pf team. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116048 
State-Changed-From-To: open->closed 
State-Changed-By: mlaier 
State-Changed-When: Mon Sep 3 13:27:28 UTC 2007 
State-Changed-Why:  
As detailed in the man-page the anchor name must be enclosed in "" when 
using wildcards.  i.e anchor "foo/*" 

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