Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2001 19:41:56 -0600 (MDT)
From:      Mike Durian <durian@boogie.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/29185: ipfw doesn't confirm icmptypes correctly
Message-ID:  <200107240141.f6O1fu402243@fever.boogie.com>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107240141.f6O1fu402243>