Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 2002 17:02:27 -0800
From:      Luigi Rizzo <luigi@FreeBSD.ORG>
To:        Ian Dowse <iedowse@maths.tcd.ie>
Cc:        Alexander Langer <alex@big.endian.de>, Patrick Soltani <psoltani@ultradns.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: panic: icmp_error: bad length
Message-ID:  <20021211170227.A79864@xorpc.icir.org>
In-Reply-To: <200212120054.aa55340@salmon.maths.tcd.ie>; from iedowse@maths.tcd.ie on Thu, Dec 12, 2002 at 12:54:48AM %2B0000
References:  <20021211233246.GR64335@fump.kawo2.rwth-aachen.de> <200212120054.aa55340@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
the diagnosis looks reasonable, though i do not remember changing
anything related to this between 4.6 and 4.7 so i wonder why the
error did not appear in earlier versions of the code.

icmp_error() consumes the mbuf so i believe it is ok to scramble it
but one should double check.
Note that NTOHS() seem to be deprecated in favour of the function version
of the same

	cheers
	luigi

On Thu, Dec 12, 2002 at 12:54:48AM +0000, Ian Dowse wrote:
> 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

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?20021211170227.A79864>