From alexd@orlando.vinf.ru  Thu Feb 27 04:53:44 2003
Return-Path: <alexd@orlando.vinf.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4214337B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Feb 2003 04:53:44 -0800 (PST)
Received: from mpool.st.simbirsk.su (mpool.vinf.ru [213.242.40.129])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4058943FCB
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Feb 2003 04:53:41 -0800 (PST)
	(envelope-from alexd@orlando.vinf.ru)
Received: from orlando.vinf.ru (root@orlando.vinf.ru [213.242.40.138])
	by mpool.st.simbirsk.su (8.11.2-MVC-VI/8.11.2) with ESMTP id h1RCrZE14678;
	Thu, 27 Feb 2003 15:53:36 +0300 (MSK)
	(envelope-from alexd@orlando.vinf.ru)
Received: from orlando.vinf.ru (alexd@localhost [127.0.0.1])
	by orlando.vinf.ru (8.12.6/8.11.4) with ESMTP id h1RCrZnt006554;
	Thu, 27 Feb 2003 15:53:35 +0300 (MSK)
	(envelope-from alexd@orlando.vinf.ru)
Received: (from alexd@localhost)
	by orlando.vinf.ru (8.12.6/8.12.6/Submit) id h1RCrYU2006553;
	Thu, 27 Feb 2003 15:53:34 +0300 (MSK)
Message-Id: <200302271253.h1RCrYU2006553@orlando.vinf.ru>
Date: Thu, 27 Feb 2003 15:53:34 +0300 (MSK)
From: "Alex L. Demidov" <alexd@vinf.ru>
Reply-To: "Alex L. Demidov" <alexd@vinf.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: alexd@vinf.ru
Subject: ipnat corrupts packets on gre interface with <rdr> rules
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         48741
>Category:       kern
>Synopsis:       [ipfilter] ipnat corrupts packets on gre interface with <rdr> rules
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    cy
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 27 05:00:26 PST 2003
>Closed-Date:    
>Last-Modified:  Wed Jul 03 05:10:40 UTC 2013
>Originator:     Alex L. Demidov
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
Variant-Inform ISP
>Environment:
System: FreeBSD orlando.vinf.ru 4.7-STABLE FreeBSD 4.7-STABLE #13: Tue Jan 21 20:29:38 MSK 2003 root@orlando.vinf.ru:/.ftp/obj/.src/src/sys/ORLANDO i386


>Description:
When using ipnat <rdr> rules for redirecting packets incoming on gre 
interface, ipnat replaces destination ip:port pair (right) and 
swaps destination ip:port with source ip:port (?!).

>How-To-Repeat:

initialize gre tunnel 
initialize ipnat
  $ echo 'rdr gre0 0.0.0.0/0 port 80 -> ${server} port 3128 tcp' > ipnat.rules
  $ ipnat -CF -f ipnat.rules
generate some traffice from host ${client}  incoming to gre interface with destination port = 80.
  $ tcpdump -v -i gre0 src host ${client} and dst port 80
and another instance of tcpdump
  $ tcpdump -v -i ${primary_interface} src host ${server} and src port 3128 and dst host ${client}

You will see something like I captured today:

gre0: 1:50:31.024708 ${client}.4867 > ${somehost}.http: S [tcp sum ok] 2382677246:2382677246(0) win 8760 <mss 1460,nop,nop,sackOK> (DF) (ttl 125, id 60400, len 48)

xl0: 01:50:31.024771 ${server}.3128 > ${client}.4867: S [tcp sum ok] 175447728:175447728(0) ack 2382677247 win 57344 <mss 1460> (DF) (ttl 64, id 6641, len 44, bad cksum 0!)

gre0: 01:50:33.989896 ${client}.4867 > ${somehost}.http: S [tcp sum ok] 2382677246:2382677246(0) win 8760 <mss 1460,nop,nop,sackOK> (DF) (ttl 125, id 60402, len 48)

xl0: 1:50:33.989953 ${server}.3128 > ${client}.4867: S [tcp sum ok] 175447728:175447728(0) ack 2382677247 win 57344 <mss 1460> (DF) (ttl 64, id 6661, len 44, bad cksum 0!)

>Fix:

	Don't know.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->darrenr 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Jul 18 15:11:30 PDT 2003 
Responsible-Changed-Why:  
Assign to ipfilter author 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48741 

From: Sergey Svishchev <svs@ropnet.ru>
To: bug-followup@FreeBSD.org, alexd@vinf.ru
Cc:  
Subject: Re: kern/48741
Date: Sat, 11 Aug 2007 14:48:41 +0400

 That looks like a normal SYN-ACK response.  Are you sure there's a problem with 
 ipnat?
 
 -- 
 Sergey Svishchev
State-Changed-From-To: open->open 
State-Changed-By: linimon 
State-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
State-Changed-Why:  
commit bit has been taken in for safekeeping. 

To submitter: is this aging PR still a problem? 


Responsible-Changed-From-To: darrenr->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=48741 
Responsible-Changed-From-To: freebsd-net->cy 
Responsible-Changed-By: cy 
Responsible-Changed-When: Wed Jul 3 05:10:26 UTC 2013 
Responsible-Changed-Why:  
Mine. 

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