From sra01@nsfw.cis.iwate-u.ac.jp  Wed Jun 20 07:48:13 2007
Return-Path: <sra01@nsfw.cis.iwate-u.ac.jp>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0E2C116A468
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Jun 2007 07:48:13 +0000 (UTC)
	(envelope-from sra01@nsfw.cis.iwate-u.ac.jp)
Received: from nsfw.cis.iwate-u.ac.jp (nsfw.cis.iwate-u.ac.jp [160.29.192.249])
	by mx1.freebsd.org (Postfix) with ESMTP id 9911313C468
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Jun 2007 07:48:12 +0000 (UTC)
	(envelope-from sra01@nsfw.cis.iwate-u.ac.jp)
Received: from nsfw.cis.iwate-u.ac.jp (localhost4 [127.0.0.1])
	by nsfw.cis.iwate-u.ac.jp (8.13.8/8.13.8) with ESMTP id l5K7RXAB081586;
	Wed, 20 Jun 2007 16:27:33 +0900 (JST)
	(envelope-from sra01@nsfw.cis.iwate-u.ac.jp)
Received: (from sra01@localhost)
	by nsfw.cis.iwate-u.ac.jp (8.13.8/8.13.8/Submit) id l5K7RWDi081585;
	Wed, 20 Jun 2007 16:27:32 +0900 (JST)
	(envelope-from sra01)
Message-Id: <200706200727.l5K7RWDi081585@nsfw.cis.iwate-u.ac.jp>
Date: Wed, 20 Jun 2007 16:27:32 +0900 (JST)
From: kabe@sra-tohoku.co.jp
Reply-To: kabe@sra-tohoku.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Cc: kabe@sra-tohoku.co.jp
Subject: [ipf][patch] ipfstat -D, -S does not accept "any" as host address
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         113879
>Category:       bin
>Synopsis:       [ipf][patch] ipfstat -D, -S does not accept "any" as host address
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    darrenr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 20 07:50:03 GMT 2007
>Closed-Date:    Sat Oct 27 16:07:05 UTC 2007
>Last-Modified:  Sat Oct 27 16:07:05 UTC 2007
>Originator:     Taketo Kabe
>Release:        FreeBSD 6.2-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD nsfw.cis 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #1: Fri May 25 14:45:23 JST 2007 root@core.cis:/usr/obj/var/src62/src/sys/GENERIC i386

>Description:
	ipfstat(8) is described to accept "any" as host address filter
	for -D and -S options i.e "-D any,<portnum>", but didn't.

	Just adding "ok = 1;" in ipfstat.c to set the parsed flag fixes this.

	[This fix is not FreeBSD specific and should be submitted to 
	 ipfilter core also]

>How-To-Repeat:
	# ipfstat -S any,any
	Invalid IP address: any

>Fix:

--- src/contrib/ipfilter/tools/ipfstat.c.dist	Thu Aug 24 07:37:10 2006
+++ src/contrib/ipfilter/tools/ipfstat.c	Wed Jun 20 06:54:57 2007
@@ -1567,7 +1567,7 @@
 			*port = -1;
 		} else if (!sscanf(comma + 1, "%d", port) ||
 			   (*port < 0) || (*port > 65535)) {
-			fprintf(stderr, "Invalid port specfication in %s\n",
+			fprintf(stderr, "Invalid port specification in %s\n",
 				argument);
 			free(s);
 			exit(-2);
@@ -1579,6 +1579,7 @@
 	/* get ip address */
 	if (!strcasecmp(s, "any")) {
 		ip->in4.s_addr = INADDR_ANY;
+		ok = 1;
 #ifdef	USE_INET6
 		ip->in6 = in6addr_any;
 	} else if (use_inet6 && inet_pton(AF_INET6, s, &ip->in6)) {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->darrenr 
Responsible-Changed-By: remko 
Responsible-Changed-When: Wed Jun 20 09:10:13 UTC 2007 
Responsible-Changed-Why:  
darren can you have a look at this please? you are also the upstream 
maintainer :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113879 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/113879: commit references a PR
Date: Sun, 24 Jun 2007 16:39:19 +0000 (UTC)

 darrenr     2007-06-24 16:39:12 UTC
 
   FreeBSD src repository
 
   Modified files:
     contrib/ipfilter/tools ipfstat.c 
   Log:
   ipfstat should parse "any" when used with -D/-S command line options
   
   PR:     bin/113879
   Submitted by:   kabe@sra-tohoku.co.jp
   Reviewed by:    darrenr
   Approved by:    re
   
   Revision  Changes    Path
   1.6       +2 -1      src/contrib/ipfilter/tools/ipfstat.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: darrenr 
State-Changed-When: Sat Oct 27 16:06:46 UTC 2007 
State-Changed-Why:  
Fix committed. 

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