From nobody@FreeBSD.org  Sun May 29 01:51:46 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 989FE16A41C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2005 01:51:46 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 78BDA43D1F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2005 01:51:46 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j4T1pkou092677
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2005 01:51:46 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j4T1pk4v092676;
	Sun, 29 May 2005 01:51:46 GMT
	(envelope-from nobody)
Message-Id: <200505290151.j4T1pk4v092676@www.freebsd.org>
Date: Sun, 29 May 2005 01:51:46 GMT
From: Alexander Melkov <melkov@comptek.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: natd runs with -same_ports by default
X-Send-Pr-Version: www-2.3

>Number:         81611
>Category:       docs
>Synopsis:       [patch] natd runs with -same_ports by default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 29 02:00:09 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat Jun 19 04:42:14 UTC 2010
>Originator:     Alexander Melkov
>Release:        5.4-STABLE
>Organization:
>Environment:
FreeBSD melkov.ru 5.4-STABLE FreeBSD 5.4-STABLE #4: Sun May 29 03:46:03 MSD 2005     spamtrap@melkov.ru:/usr/obj/usr/src/sys/MELKOV  i386
>Description:
even without -same_ports | -m switch natd tries to allocate the same
source port as in the original packet.

PKT_ALIAS_SAME_PORTS flag is set up in LibAliasInit function, -m switch
can also only set this flag.

Probably this default behaviour is actually good, and that's the manpage
should be shanged, not libalias :).

>How-To-Repeat:
run natd without -m and inspect incoming and outgoing packet ports with tcpdump.

>Fix:
Workaround: create and use a config have with
same_ports no

>Release-Note:
>Audit-Trail:

From: Matteo Riondato <rionda@gufi.org>
To: bug-followup@FreeBSD.org, melkov@comptek.ru
Cc:  
Subject: Re: bin/81611: natd runs with -same_ports by default
Date: Tue, 7 Jun 2005 20:42:07 +0200

 I can confirm this.
 IMHO it's not a bug but a feature so it's the man page that should be
 fixed.
 
 Please note that this is a probably a doc bug.
 
 A patch for it follows:
 
 --- natd.8.old  Tue Jun  7 20:12:22 2005
 +++ natd.8      Tue Jun  7 20:13:07 2005
 @@ -65,8 +65,6 @@
  IP address is that of the current machine.
  For each packet changed in this manner, an internal table entry 
  created to record this fact.
 -The source port number is also changed to indicate the table ent
 -applying to the packet.
  Packets that are received with a target IP of the current host a
  checked against this internal table.
  If an entry is found, it is used to determine the correct target
 @@ -110,8 +108,9 @@
  Try to keep the same port number when altering outgoing packets.
  With this option, protocols such as RPC will have a better chanc
  of working.
 +Please note that this is the default behaviour.
  If it is not possible to maintain the port number, it will be si
 -changed as per normal.
 +changed.
 .It Fl verbose | v
 Do not call
 .Xr daemon 3
 			 
 
 Best Regards
 -- 
 Rionda aka Matteo Riondato
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Sat Mar 4 10:30:02 UTC 2006 
Responsible-Changed-Why:  
I'll handle this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81611 
Responsible-Changed-From-To: matteo->freebsd-doc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jun 19 04:41:48 UTC 2010 
Responsible-Changed-Why:  
Reset PR assigned to inactive committer. 

Hat:	gnats-admin 

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