Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2002 00:54:48 +0000
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Alexander Langer <alex@big.endian.de>
Cc:        Patrick Soltani <psoltani@ultradns.com>, freebsd-hackers@FreeBSD.ORG, luigi@FreeBSD.ORG
Subject:   Re: panic: icmp_error: bad length 
Message-ID:   <200212120054.aa55340@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Thu, 12 Dec 2002 00:32:46 %2B0100." <20021211233246.GR64335@fump.kawo2.rwth-aachen.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20021211233246.GR64335@fump.kawo2.rwth-aachen.de>, Alexander Langer
 writes:
>Yeah, same situation here.  4.6 used to work w/o problem, 4.7 doesn't.

Great, thanks for the debugging info. The bug seems to be that
icmp_error() requires that the IP header fields are in host order,
but when it is called on a briged packet by the IPFW code, this is
not the case. Something like the patch below (untested) should fix
the IPFW1 case. A similar change is needed for IPFW2.

Luigi: does this look reasonable? I'm not familiour enough with the
IPFW code to know if it is OK to modify the mbuf like this. If not
then it needs to be copied first like ip_forward() does, making
sure that the IP header does not end up in a shared cluster.

Ian

Index: ip_fw.c
===================================================================
RCS file: /home/iedowse/CVS/src/sys/netinet/ip_fw.c,v
retrieving revision 1.131.2.38
diff -u -r1.131.2.38 ip_fw.c
--- ip_fw.c	21 Nov 2002 01:27:30 -0000	1.131.2.38
+++ ip_fw.c	12 Dec 2002 00:43:22 -0000
@@ -1573,6 +1573,11 @@
 			break;
 		  }
 		default:	/* Send an ICMP unreachable using code */
+			/* Must convert to host order for icmp_error(). */
+			if (BRIDGED) {
+				NTOHS(ip->ip_len);
+				NTOHS(ip->ip_off);
+			}
 			icmp_error(*m, ICMP_UNREACH,
 			    f->fw_reject_code, 0L, 0);
 			*m = NULL;


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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