I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 1cdcf1cb authored by zzz's avatar zzz
Browse files

i2ptunnel: Display warning for duplicate client ports (ticket #1265)

parent 56b6992c
No related branches found
No related tags found
No related merge requests found
...@@ -490,6 +490,16 @@ public class IndexBean { ...@@ -490,6 +490,16 @@ public class IndexBean {
return "<font color=\"red\">" + return "<font color=\"red\">" +
_("Warning - ports less than 1024 are not recommended") + _("Warning - ports less than 1024 are not recommended") +
": " + port + "</font>"; ": " + port + "</font>";
// dup check, O(n**2)
List<TunnelController> controllers = _group.getControllers();
for (int i = 0; i < controllers.size(); i++) {
if (i == tunnel)
continue;
if (port.equals(controllers.get(i).getListenPort()))
return "<font color=\"red\">" +
_("Warning - duplicate port") +
": " + port + "</font>";
}
return port; return port;
} }
return "<font color=\"red\">" + _("Port not set") + "</font>"; return "<font color=\"red\">" + _("Port not set") + "</font>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment