Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2007 14:49:22 -0800
From:      Chuck Swiger <cswiger@mac.com>
To:        "Bruce M. Simpson" <bms@FreeBSD.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>, Ricardo Nabinger Sanchez <rnsanchez@wait4.org>, hugme@hugme.org
Subject:   Re: Problem with port 0
Message-ID:  <9A4F1DBC-B536-4845-811B-8546E4201D69@mac.com>
In-Reply-To: <45A807F8.7080603@FreeBSD.org>
References:  <f9876c510701120903r65543ef4nafc7eeead2becb42@mail.gmail.com> <20070112163057.2a3ec8f0.rnsanchez@wait4.org> <45A807F8.7080603@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 12, 2007, at 2:13 PM, Bruce M. Simpson wrote:
> Ricardo Nabinger Sanchez wrote:
>> But port 0 has special meaning to the kernel (ie, "give me some  
>> random
>> port").  Also, it is a reserved one.  Please check IANA:
>>
>> 	http://www.iana.org/assignments/port-numbers
>>
>> I'm afraid you'll have to select another port number.
>>
> Nope. A source port of 0 is perfectly legal for UDP.

There's nothing in RFC-768 which forbids one from using a source or  
destination port of 0, but it also is true that IANA reserves 0/tcp  
and 0/udp for exactly the reasons Ricardo mentioned.  I know that at  
least some firewalls will explicitly drop traffic using port 0  
because it is expected that a well-behaved network stack will  
reassign a random ephemeral port rather than sending traffic out to  
or from port 0...YMMV.

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9A4F1DBC-B536-4845-811B-8546E4201D69>