* Console, i2ptunnel: Warn on low ports

This commit is contained in:
zzz
2012-10-09 10:13:10 +00:00
parent e99dd72cb6
commit 23c77fbe4b
2 changed files with 20 additions and 4 deletions

View File

@@ -458,8 +458,13 @@ public class IndexBean {
String port = tun.getListenPort();
if (port.length() == 0)
return "<font color=\"red\">" + _("Port not set") + "</font>";
if (Addresses.getPort(port) == 0)
int iport = Addresses.getPort(port);
if (iport == 0)
return "<font color=\"red\">" + _("Invalid port") + ' ' + port + "</font>";
if (iport < 1024)
return "<font color=\"red\">" +
_("Warning - ports less than 1024 are not recommended") +
": " + port + "</font>";
return port;
}
return "<font color=\"red\">" + _("Port not set") + "</font>";