kern/71652: rdr@pf doesnt work properly with fastforwarding

Max Laier max at love2party.net
Sun Sep 12 17:00:56 PDT 2004


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

From: Max Laier <max at love2party.net>
To: freebsd-gnats-submit at FreeBSD.org, xdivac02 at stud.fit.vutbr.cz
Cc:  
Subject: Re: kern/71652: rdr at pf doesnt work properly with fastforwarding
Date: Mon, 13 Sep 2004 01:56:42 +0200

 --Boundary-00=_8IORB59XSICYAUR
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 This is caused by a superfluous byte order change in ip_fastfwd.c while the 
 comment in ip_input.c clearly states what is expected:
     /*
      * ip_fastforward firewall changed dest to local.
      * We expect ip_len and ip_off in host byte order.
      */
 
 Diff attached and on: 
 http://people.freebsd.org/~mlaier/FASTFWD_OURS.byteorder.diff
 
 -- 
  Max
 
 --Boundary-00=_8IORB59XSICYAUR
 Content-Type: text/x-diff;
   charset="us-ascii";
   name="FASTFWD_OURS.byteorder.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="FASTFWD_OURS.byteorder.diff"
 
 Index: ip_fastfwd.c
 ===================================================================
 RCS file: /usr/store/mlaier/fcvs/src/sys/netinet/ip_fastfwd.c,v
 retrieving revision 1.19
 diff -u -r1.19 ip_fastfwd.c
 --- ip_fastfwd.c	27 Aug 2004 15:32:28 -0000	1.19
 +++ ip_fastfwd.c	12 Sep 2004 23:50:34 -0000
 @@ -465,16 +465,15 @@
  		if (in_localip(dest) || m->m_flags & M_FASTFWD_OURS) {
  #endif /* IPFIREWALL_FORWARD */
  forwardlocal:
 -			/* for ip_input */
 -			m->m_flags |= M_FASTFWD_OURS;
 -			ip->ip_len = htons(ip->ip_len);
 -			ip->ip_off = htons(ip->ip_off);
 -
  			/*
  			 * Return packet for processing by ip_input()
 +			 * Keep host byte order as excepted at ip_input's
 +			 * "ours"-label
  			 */
 +			m->m_flags |= M_FASTFWD_OURS;
  			if (ro.ro_rt)
  				RTFREE(ro.ro_rt);
 +
  			return 0;
  		}
  		/*
 
 --Boundary-00=_8IORB59XSICYAUR--


More information about the freebsd-bugs mailing list