kern/111313: packet with IP option corrupted when going through Dummynet

Marcin Cieslak saper at SYSTEM.PL
Fri Jun 1 21:50:07 UTC 2007


The following reply was made to PR kern/111313; it has been noted by GNATS.

From: Marcin Cieslak <saper at SYSTEM.PL>
To: bug-followup at FreeBSD.org
Cc: luping at cs.unc.edu, remko at FreeBSD.org
Subject: Re: kern/111313: packet with IP option corrupted when going through
 Dummynet
Date: Fri, 01 Jun 2007 23:13:19 +0200

 This modification goes down to the patch listed below.
 
 I am experiencing similar problem with IPSec ESP+NAT-T
 encapsulated packets, so maybe there is something there.
 
 (It still applies cleanly to the sys/netinet/ip_output.c revision
 1.242.2.15 or even 1.242.2.18 (current as of time of the writing)).
 
 -- 
               << Marcin Cieslak // saper at system.pl >>
 
 --- ip_output.c	Fri Jun  1 22:56:35 2007
 +++ ip_output_111313.c	Fri Jun  1 22:55:50 2007
 @@ -159,6 +159,10 @@
  	}
  	ip = mtod(m, struct ip *);
 
 +	/* luping modification */
 +	struct m_tag *dn_tag;
 +	dn_tag = m_tag_find(m, PACKET_TAG_DUMMYNET, NULL);
 +
  	/*
  	 * Fill in IP header.  If we are not allowing fragmentation,
  	 * then the ip_id field is meaningless, but we don't set it
 @@ -172,7 +176,11 @@
  	 */
  	if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
  		ip->ip_v = IPVERSION;
 -		ip->ip_hl = hlen >> 2;
 +		//luping modification
 +		if (dn_tag == NULL)
 +			ip->ip_hl = hlen >> 2;
 +		else
 +			hlen = ip->ip_hl << 2;
  		ip->ip_id = ip_newid();
  		ipstat.ips_localout++;
  	} else {
 
 


More information about the freebsd-bugs mailing list