Date: Wed, 7 Jul 2004 14:13:05 -0700 (PDT) From: Nicolas Dehaine <nicko@stbernard.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/68785: Incorrect parsing of 0.0.0.0/0 as 'me' in ipfw(8) (fwd) Message-ID: <20040707141211.B9678@greenroom.rapid.stbernard.com> Resent-Message-ID: <200407072120.i67LKNmK093154@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040707141211.B9678>