Subject: Re: bin/19069: traceroute(8) and traceroute6(8) can send packet to udp port 0, which is illegal
To: Robert Elz <kre@munnari.OZ.AU>
From: None <itojun@iijlab.net>
List: netbsd-bugs
Date: 11/17/2002 23:33:39
>  | >Description:
>  | 	if you specify large starting port to traceroute(8) or traceroute6(8)
>  | 	with -p, it can emit packet to udp port 0, which is illegal.
>  | 	(source port 0 is legal, destinationi port 0 is illegal based on
>  | 	udp spec)
>I don't mind the traceroute change, but from where (which RFC) does this
>"destination port 0 is illegal" come from?
>
>It isn't in 768, which says only...
>
>  Destination  Port has a meaning  within  the  context  of  a  particular
>  internet destination address.
>
>nor is it in 1122, which says nothing much at all about port numbers
>(other than some text included by reference from tcp about well known
>port numbers - which explicitly includes port 0).
>
>Is there some other RFC I'm missing?

	port 0 is "reserved" on assigned numbers RFC.  it has a special
	meaning when it appears on source - means "no source port is specified".

>Source Port is an optional field, when meaningful, it indicates the port
>of the sending  process,  and may be assumed  to be the port  to which a
>reply should  be addressed  in the absence of any other information.  If
>not used, a value of zero is inserted.

	there's no declaration for the use in destionation port, which led
	me to believe it is not legal to use port 0 as destination port.
	in fact, BSD implementation relies upon the fact port 0 is not used
	on wire, as bind(2) to port 0 will mean "the port is now not bound".
	am i reading too much between lines?

itojun