Skip Menu |

This queue is for tickets about the Net-TFTPd CPAN distribution.

Report information
The Basics
Id: 33486
Status: rejected
Worked: 1 min
Priority: 0/
Queue: Net-TFTPd

People
Owner: lmasarati [...] hotmail.com
Requestors: sk8boardkid [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.03
Fixed in: (no value)



Subject: No way to automatically select a free listening port
With IO::Socket you can pass a local port of "0" then system will then pick the next free high port. You can then use the following code to get the value that was assigned: my $sockAddr = getsockname($socket); my($port, undef) = sockaddr_in($sockAddr); #get the port number that linux gave us To fix you could to the following in the contructor: my %params = ( 'Proto' => 'udp', 'LocalPort' => $cfg{'LocalPort'} #use local port if given ); Rather than: my %params = ( 'Proto' => 'udp', 'LocalPort' => $cfg{'LocalPort'} || TFTP_DEFAULT_PORT, ); I'm not sure how portable this would be
Please note that this module is used to create a listening server, if you randomly choose a listening port, how do you instruct clients to guess it? That's the reason why you can choose a custom port or use the IANA assigned TFTP port 69 as default. Bye. Luigino.
It is by design. Please note that this module is used to create a listening server, if you randomly choose a listening port, how do you instruct clients to guess it? That's the reason why you can choose a custom port or use the IANA assigned TFTP port 69 as default. Bye. Luigino.