Date: Wed, 20 Jun 2007 16:27:32 +0900 (JST) From: kabe@sra-tohoku.co.jp To: FreeBSD-gnats-submit@FreeBSD.org Cc: kabe@sra-tohoku.co.jp Subject: bin/113879: [ipf][patch] ipfstat -D, -S does not accept "any" as host address Message-ID: <200706200727.l5K7RWDi081585@nsfw.cis.iwate-u.ac.jp> Resent-Message-ID: <200706200750.l5K7o3VP055698@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 20 07:50:03 GMT 2007 >Closed-Date: >Last-Modified: >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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706200727.l5K7RWDi081585>