From owner-freebsd-bugs Mon Jul 23 18:40: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5733937B405 for ; Mon, 23 Jul 2001 18:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6O1e1E20167; Mon, 23 Jul 2001 18:40:01 -0700 (PDT) (envelope-from gnats) Received: from fever.boogie.com (cpe-66-87-52-132.co.sprintbbd.net [66.87.52.132]) by hub.freebsd.org (Postfix) with ESMTP id 316AC37B401 for ; Mon, 23 Jul 2001 18:39:07 -0700 (PDT) (envelope-from durian@fever.boogie.com) Received: (from durian@localhost) by fever.boogie.com (8.11.4/8.11.4) id f6O1fu402243; Mon, 23 Jul 2001 19:41:56 -0600 (MDT) (envelope-from durian) Message-Id: <200107240141.f6O1fu402243@fever.boogie.com> Date: Mon, 23 Jul 2001 19:41:56 -0600 (MDT) From: Mike Durian Reply-To: Mike Durian To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/29185: ipfw doesn't confirm icmptypes correctly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 29185 >Category: bin >Synopsis: ipfw doesn't confirm icmptypes correctly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 23 18:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Mike Durian >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD fever.boogie.com 5.0-CURRENT FreeBSD 5.0-CURRENT #10: Mon Jul 23 17:22:26 MDT 2001 root@fever.boogie.com:/usr/obj/usr/src/sys/BOOGIE i386 >Description: When you add an ipfw rule that contains an icmptypes constraint, ipfw does not echo the icmptype value correctly. Instead, it echo's the index of the unsigned integer containing the bit mask. It should instead echo (index * sizeof(unsigned) * 8) + bit offset. I believe the rule itself is being instantiated correctly. >How-To-Repeat: ipfw add allow icmp from any to any icmptypes 0,8 >Fix: *** ipfw.c.orig Mon Jul 23 18:21:54 2001 --- ipfw.c Mon Jul 23 18:22:54 2001 *************** *** 545,551 **** for (i = 0; i < IP_FW_ICMPTYPES_DIM; ++i) for (j = 0; j < sizeof(unsigned) * 8; ++j) if (chain->fw_uar.fw_icmptypes[i] & (1 << j)) { ! printf("%c%d", first ? ' ' : ',', i); first = 0; } } --- 545,552 ---- for (i = 0; i < IP_FW_ICMPTYPES_DIM; ++i) for (j = 0; j < sizeof(unsigned) * 8; ++j) if (chain->fw_uar.fw_icmptypes[i] & (1 << j)) { ! printf("%c%d", first ? ' ' : ',', ! i * sizeof(unsigned) * 8 + j); first = 0; } } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message