From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 7 21:20:23 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF79A16A4CF for ; Wed, 7 Jul 2004 21:20:23 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB9D043D5C for ; Wed, 7 Jul 2004 21:20:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i67LKNtU093155 for ; Wed, 7 Jul 2004 21:20:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i67LKNmK093154; Wed, 7 Jul 2004 21:20:23 GMT (envelope-from gnats) Resent-Date: Wed, 7 Jul 2004 21:20:23 GMT Resent-Message-Id: <200407072120.i67LKNmK093154@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nicolas Dehaine Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FBC516A4CE for ; Wed, 7 Jul 2004 21:13:36 +0000 (GMT) Received: from mail01.stbernard.com (mail01.stbernard.com [199.245.188.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CD9E43D53 for ; Wed, 7 Jul 2004 21:13:36 +0000 (GMT) (envelope-from nicko@stbernard.com) Received: from greenroom.rapid.stbernard.com ([192.168.3.6]) by mail01.stbernard.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 7 Jul 2004 14:13:35 -0700 Message-Id: <20040707141211.B9678@greenroom.rapid.stbernard.com> Date: Wed, 7 Jul 2004 14:13:05 -0700 (PDT) From: Nicolas Dehaine To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/68785: Incorrect parsing of 0.0.0.0/0 as 'me' in ipfw(8) (fwd) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2004 21:20:24 -0000 >Number: 68785 >Category: bin >Synopsis: Incorrect parsing of 0.0.0.0/0 as 'me' in ipfw(8) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 07 21:20:23 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Nicolas Dehaine >Release: FreeBSD 5.2.1-RELEASE i386 >Organization: St Bernard >Environment: System: FreeBSD nks 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Tue Apr 20 15:49:16 PDT 2004 root@nks:/usr/src/sys/i386/compile/KERNEL i386 >Description: ipfw(8) parses 0.0.0.0/0 as "me" instead of "any" when adding a forward rule >How-To-Repeat: /sbin/ipfw "add fwd 127.0.0.1,80 tcp from 0.0.0.0/0 to 0.0.0.0/0 dst-port 80 in via fxp1" 00100 fwd 127.0.0.1 tcp from me to me dst-port 80 in via fxp1 >Fix: The following works for me : Index: ipfw2.c =================================================================== RCS file: /usr/cvsroot/freebsd5/src/sbin/ipfw/ipfw2.c,v retrieving revision 1.1.1.2 diff -c -r1.1.1.2 ipfw2.c *** ipfw2.c 18 Mar 2004 02:10:47 -0000 1.1.1.2 --- ipfw2.c 7 Jul 2004 16:51:12 -0000 *************** *** 2040,2045 **** --- 2040,2048 ---- if (av == NULL && len == 0) /* only this entry */ errx(EX_DATAERR, "not any never matches"); } + /* if x.x.x.x/0 is the only entry, return any */ + if (av == NULL && len == 0) /* only this entry */ + return; /* else do nothing and skip this entry */ continue; } >Release-Note: >Audit-Trail: >Unformatted: