kern/58287: ipnat map protocol specification broken

Matthew George mdg at
Mon Oct 20 09:10:13 PDT 2003

>Number:         58287
>Category:       kern
>Synopsis:       ipnat map protocol specification broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 20 09:10:11 PDT 2003
>Originator:     Matthew George
>Release:        FreeBSD 4.8-RELEASE-p1 i386
System: FreeBSD 4.8-RELEASE-p1 FreeBSD 4.8-RELEASE-p1 #4: Thu Sep 25 12:29:50 EDT 2003 mdg at i386

	The docs in ipnat(5) provide the following description of ipnat map
	with regards to protocol specification:

	map ::= mapit ifname ipmask "->" dstipmask [ mapport ] mapoptions.
	mapoptions ::= [ tcpudp ] [ "frag" ] [ age ] [ clamp ] .
	tcpudp ::= "tcp/udp" | protocol .
	protocol ::= protocol-name | decnumber .

	However, ipnat refuses to properly parse a rule with a protocol specified.

	# ipnat -f -
	map dc0 from to any -> w.x.y.z/32 icmp
	1: extra junk at the end of the line: icmp
	1: syntax error in "map"


	I only looked at this very shortly, but the problem appears to be around
	line 458 of natparse.c.  It looks like the protocol is only examined and
	dealt with if !(ipn.in_redir & (NAT_MAP|NAT_MAPBLK)).

Matthew George
SecureWorks Technical Operations


More information about the freebsd-bugs mailing list