* Sending UDP packets to port 0
@ 2008-06-22 8:19 Christian P. Schmidt
2008-06-22 9:11 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: Christian P. Schmidt @ 2008-06-22 8:19 UTC (permalink / raw)
To: linux-kernel
Hi all,
I know that the kernel forbids sending UDP packets to port 0. Is there a
specific reason for this?
I'm asking because I regularly need to access a device that asks for
tftp files using port 0 as source. To use these devices I'm using a
kernel with removed port 0 checks.
I read RFC 768, and it does not explicitly forbid the use of port 0 as
far as I can see. It only says that if unused, 0 is to be inserted.
RFC 1350 (TFTP) even states explicitly:
The transfer identifiers (TID's) used by TFTP are passed to the Datagram
layer to be used as ports; therefore they must be between 0 and 65,535.
In my understanding, and apparently that of the authors of the
appliance's tftp client implementation, this marks port 0 as valid.
Please CC: me on any replies as I am not subscribed to the list.
Regards,
Chris
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Sending UDP packets to port 0
2008-06-22 8:19 Sending UDP packets to port 0 Christian P. Schmidt
@ 2008-06-22 9:11 ` Jan Engelhardt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2008-06-22 9:11 UTC (permalink / raw)
To: Christian P. Schmidt; +Cc: linux-kernel
On Sunday 2008-06-22 10:19, Christian P. Schmidt wrote:
>
> RFC 1350 (TFTP) even states explicitly:
> The transfer identifiers (TID's) used by TFTP are passed to the Datagram layer
> to be used as ports; therefore they must be between 0 and 65,535.
One could interpret "between" as 0 > x < 65535 and not
0 >= x <= 65535 (that could be "between (inclusive)").
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Sending UDP packets to port 0
[not found] <aHtAJ-8bW-11@gated-at.bofh.it>
@ 2008-06-22 10:02 ` Alan Jenkins
0 siblings, 0 replies; 3+ messages in thread
From: Alan Jenkins @ 2008-06-22 10:02 UTC (permalink / raw)
To: Christian P. Schmidt; +Cc: linux-kernel
Christian P. Schmidt wrote:
> Hi all,
>
> I know that the kernel forbids sending UDP packets to port 0. Is there a
> specific reason for this?
_Source_ port 0 is treated specially in the sockets implementation,
though I'm not sure whether this is an intended feature of the API
(manpages don't mention it). If you say "bind to port 0", you get an
arbitrary unused port instead, which is potentially useful.
> I'm asking because I regularly need to access a device that asks for
> tftp files using port 0 as source. To use these devices I'm using a
> kernel with removed port 0 checks.
>
> I read RFC 768, and it does not explicitly forbid the use of port 0 as
> far as I can see. It only says that if unused, 0 is to be inserted.
1. No, it only says that about the source port.
2. The only way to tell whether the field is "unused" is to check for
a 0 value.
> RFC 1350 (TFTP) even states explicitly:
> The transfer identifiers (TID's) used by TFTP are passed to the Datagram
> layer to be used as ports; therefore they must be between 0 and 65,535.
>
> In my understanding, and apparently that of the authors of the
> appliance's tftp client implementation, this marks port 0 as valid.
They're a bit mad then. RFC1700 marks port 0 as "reserved" (other
unused ports are marked "unassigned").
I hope that explains why most sane people would avoid using port 0. I
can't think of a specific reason for forbidding port 0 as a
destination; it's just generally not expected (and there was no reason
to allow it). I think you need to be more specific if you hope to
have this check removed in mainline though.
Which TCP/IP stacks is the device tested/supported against? Are you
saying Windows or some other OS lets you send to port 0?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-22 10:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22 8:19 Sending UDP packets to port 0 Christian P. Schmidt
2008-06-22 9:11 ` Jan Engelhardt
[not found] <aHtAJ-8bW-11@gated-at.bofh.it>
2008-06-22 10:02 ` Alan Jenkins
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.