From xdivac02@stud.fit.vutbr.cz  Sun Sep 12 14:30:31 2004
Return-Path: <xdivac02@stud.fit.vutbr.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BF19416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 14:30:31 +0000 (GMT)
Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5E90143D45
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 14:30:30 +0000 (GMT)
	(envelope-from xdivac02@stud.fit.vutbr.cz)
Received: from eva.fit.vutbr.cz (localhost [127.0.0.1])
	by eva.fit.vutbr.cz (8.12.11/8.12.11) with ESMTP id i8CEUP0A080805
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 16:30:25 +0200 (CEST)
Received: (from xdivac02@localhost)
	by eva.fit.vutbr.cz (8.12.11/8.12.5/Submit) id i8CEUPGZ080804;
	Sun, 12 Sep 2004 16:30:25 +0200 (CEST)
Message-Id: <200409121430.i8CEUPGZ080804@eva.fit.vutbr.cz>
Date: Sun, 12 Sep 2004 16:30:25 +0200 (CEST)
From: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
Reply-To: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: rdr@pf doesnt work properly with fastforwarding
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71652
>Category:       kern
>Synopsis:       rdr@pf doesnt work properly with fastforwarding
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    andre
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 14:40:12 GMT 2004
>Closed-Date:    Thu Sep 16 20:37:31 GMT 2004
>Last-Modified:  Thu Sep 16 20:37:31 GMT 2004
>Originator:     Divacky Roman
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
>Environment:
FreeBSD queeg500 5.3-BETA3 FreeBSD 5.3-BETA3 #5: Tue Sep  7 13:01:38 CEST 2004
   rdivacky@queeg500:/usr/obj/usr/src/sys/QUEEG  i386
   
	
>Description:
	The problem reported in bin/71490 was fixed by setting
	net.inet.ip.fastforwarding=0
	ie. by setting it to 1 (enabling it) the rdr doesnt work properly
	
>How-To-Repeat:

set net.inet.ip.fastforwarding=1 and try to use rdr and/or ftp-proxy

>Fix:

I am not aware of any.

>Release-Note:
>Audit-Trail:

From: Max Laier <max@love2party.net>
To: freebsd-gnats-submit@FreeBSD.org, xdivac02@stud.fit.vutbr.cz
Cc:  
Subject: Re: kern/71652: rdr@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--
Responsible-Changed-From-To: freebsd-bugs->andre 
Responsible-Changed-By: mlaier 
Responsible-Changed-When: Mon Sep 13 00:05:07 GMT 2004 
Responsible-Changed-Why:  
Over to Andre for evaluation. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71652 
State-Changed-From-To: open->patched 
State-Changed-By: andre 
State-Changed-When: Mon Sep 13 17:02:18 GMT 2004 
State-Changed-Why:  
The problem is patched in sys/netinet/ip_fastfwd.c rev. 1.20. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71652 
State-Changed-From-To: patched->closed 
State-Changed-By: andre 
State-Changed-When: Thu Sep 16 20:37:05 GMT 2004 
State-Changed-Why:  
MFC to RELENG_5 is done.  Case closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71652 
>Unformatted:
