Subject: Re: ipmon-related crashing???
To: Wolfgang Rupprecht <wolfgang@wsrcc.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 01/29/1999 12:25:35
On 28 Jan 1999 19:59:05 -0800 
 Wolfgang Rupprecht <wolfgang@wsrcc.com> wrote:

 > I don't know if its related, but I'm seeing lots of bad lengths on mrouted.
 > 
 > Jan 25 21:37:07 capsicum mrouted[18208]: warning - received packet from 5.0.0.4 shorter (32 bytes) than hdr+data length (24+32)
 > Jan 25 21:37:08 capsicum mrouted[18208]: warning - received packet from 24.1.64.1 shorter (28 bytes) than hdr+data length (20+28)
 > Jan 25 21:37:09 capsicum mrouted[18208]: warning - received packet from 24.1.78.151 shorter (32 bytes) than hdr+data length (24+32)
 > Jan 25 21:37:26 capsicum mrouted[18208]: logging too fast, shutting up for 10 minutes

Sigh.  That's because Charles changed IP to not frob ip_len to subtract the
header length.

Does the following patch help you?

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>

Index: raw_ip.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/raw_ip.c,v
retrieving revision 1.41
diff -c -r1.41 raw_ip.c
*** raw_ip.c	1998/04/03 07:49:16	1.41
--- raw_ip.c	1999/01/29 20:25:19
***************
*** 112,117 ****
--- 112,123 ----
  	ripsrc.sin_port = 0;
  	bzero((caddr_t)ripsrc.sin_zero, sizeof(ripsrc.sin_zero));
  
+ 	/*
+ 	 * XXX Compatibility: programs using raw IP expect ip_len
+ 	 * XXX to have the header length subtracted.
+ 	 */
+ 	ip->ip_len -= ip->ip_hl << 2;
+ 
  	for (inp = rawcbtable.inpt_queue.cqh_first;
  	    inp != (struct inpcb *)&rawcbtable.inpt_queue;
  	    inp = inp->inp_queue.cqe_next) {