Problem with port 0

Chuck Swiger cswiger at mac.com
Fri Jan 12 23:35:34 UTC 2007


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



More information about the freebsd-net mailing list