Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
gogo.shell-0.10.0
-
None
-
None
Description
The telnetd server only listens to IPv4 or IPv6 because the default value for the --ip parameter is "".
Even though 'localhost' resolves to both ::1 and 127.0.0.1, passing in "" for the address results in it picking one of them.
If the value is 'null' for the IP address then it will resolve and bind to both network addresses.
The bug is here:
118 server = new ServerSocket(port, 0, InetAddress.getByName(ip));
This should be:
InetAddress address = "".equals(ip) ? null : InetAddress.getByName(p);
118 server = new ServerSocket(port, 0, address);