From owner-freebsd-hackers Wed Dec 11 16:55:36 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 916CD37B401; Wed, 11 Dec 2002 16:55:34 -0800 (PST) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 3E70E43EA9; Wed, 11 Dec 2002 16:55:33 -0800 (PST) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 12 Dec 2002 00:54:50 +0000 (GMT) To: Alexander Langer Cc: Patrick Soltani , freebsd-hackers@FreeBSD.ORG, luigi@FreeBSD.ORG Subject: Re: panic: icmp_error: bad length In-Reply-To: Your message of "Thu, 12 Dec 2002 00:32:46 +0100." <20021211233246.GR64335@fump.kawo2.rwth-aachen.de> Date: Thu, 12 Dec 2002 00:54:48 +0000 From: Ian Dowse Message-ID: <200212120054.aa55340@salmon.maths.tcd.ie> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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