From nobody@FreeBSD.org  Sun Dec 30 21:00:49 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 1EE2E37B41C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Dec 2001 21:00:49 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id fBV50nN02321;
	Sun, 30 Dec 2001 21:00:49 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200112310500.fBV50nN02321@freefall.freebsd.org>
Date: Sun, 30 Dec 2001 21:00:49 -0800 (PST)
From: Matthew Whelan <muttley@gotadsl.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ipnat(5) requires mapped-to port in rdr rules
X-Send-Pr-Version: www-1.0
X-GNATS-Notify: ru

>Number:         33371
>Category:       docs
>Synopsis:       ipnat(5) requires mapped-to port in rdr rules
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    guido
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 30 21:10:01 PST 2001
>Closed-Date:    Mon Aug 26 17:17:31 PDT 2002
>Last-Modified:  Mon Aug 26 17:17:31 PDT 2002
>Originator:     Matthew Whelan
>Release:        4.5-PRERELEASE
>Organization:
>Environment:
FreeBSD ericnernie.doubleacts 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #3: Wed Dec 26 23:31:36 GMT 2001     Root@ericnernie.doubleacts:/var/cdr/usr/src/sys/MPW  i386
>Description:
The ipnat(5) man page is inconsistent with actual behaviour for redirection (rdr) rules.

From ipnat(5):


    redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] [ ports ] options

and

    options ::= [ tcpudp ] [ rr ]

But if you try to omit the [ ports ]:

    root@ericnernie# ipnat -n -f -
    rdr tun0 0/32 port 7010-7019 -> 192.168.0.3
    1: No netmask supported in destination host for redirect
    1: syntax error in "rdr"
    rdr tun0 0/32 port 7010-7019 -> 192.168.0.3 tcp
    2: missing fields - 2nd port (tcp)
    2: syntax error in "rdr"
    rdr tun0 0/32 port 7010-7019 -> 192.168.0.3 port 7010 tcp
>How-To-Repeat:
N/A
>Fix:
Amend the manpage so that

   redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] [ ports ] options

reads as
   redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] ports options
>Release-Note:
>Audit-Trail:

From: ipnat.diff@pittgoth.com
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: docs/33371: [PATCH]
Date: Mon, 31 Dec 2001 10:33:12 -0500 (EST)

 please try this patch (I hope this sends using this program LOL, if not i'll resubmit)
 

From: Tom Rhodes <darklogik@pittgoth.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: docs/33371: [PATCH]
Date: Mon, 31 Dec 2001 10:45:58 -0500 (EST)

 *** ipnat.5	Mon Dec 31 10:27:35 2001
 --- ipnat.5.new	Mon Dec 31 10:26:18 2001
 ***************
 *** 10,16 ****
   map ::= mapit ifname ipmask "->" ipmask [ mapport ] .
   map ::= mapit ifname fromto "->" ipmask [ mapport ] .
   mapblock ::= "map-block" ifname ipmask "->" ipmask [ ports ] .
 ! redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] [ ports ] options .
   
   dport ::= "port" portnum [ "-" portnum ] .
   ports ::= "ports" numports | "auto" .
 --- 10,16 ----
   map ::= mapit ifname ipmask "->" ipmask [ mapport ] .
   map ::= mapit ifname fromto "->" ipmask [ mapport ] .
   mapblock ::= "map-block" ifname ipmask "->" ipmask [ ports ] .
 ! redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] ports options . 
   
   dport ::= "port" portnum [ "-" portnum ] .
   ports ::= "ports" numports | "auto" .
Responsible-Changed-From-To: freebsd-doc->guido 
Responsible-Changed-By: ru 
Responsible-Changed-When: Wed Jan 9 01:32:04 PST 2002 
Responsible-Changed-Why:  
Guido, could you please look into it? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33371 
State-Changed-From-To: open->feedback 
State-Changed-By: guido 
State-Changed-When: Thu Jan 10 12:26:08 MET 2002 
State-Changed-Why:  
In ipf-3.4-current, a fix is in place. I want to wait until 
the release based on that version is imported. 

Btw: the patch in the PR is not completely riht. 
This is what it should have been: 
-redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] [ ports ] options . 
+redir ::= "rdr" ifname ipmask dport "->" ip [ "," ip ] rdrport options . 
+rdrport ::= "port" portnum . 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33371 
State-Changed-From-To: feedback->closed 
State-Changed-By: trhodes 
State-Changed-When: Mon Aug 26 17:16:43 PDT 2002 
State-Changed-Why:  
As the original patch submitter, I've just checked the ipnat(5) manual page 
on my STABLE box and this has been fixed.  Thanks! 

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