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

Skip to content
Snippets Groups Projects
Commit 29f9986f authored by zzz's avatar zzz
Browse files

i2ptunnel: Check for same interface before warning of dup port

parent d505a2fe
No related branches found
No related tags found
No related merge requests found
...@@ -420,13 +420,23 @@ public class IndexBean { ...@@ -420,13 +420,23 @@ public class IndexBean {
": " + port + "</font>"; ": " + port + "</font>";
// dup check, O(n**2) // dup check, O(n**2)
List<TunnelController> controllers = _group.getControllers(); List<TunnelController> controllers = _group.getControllers();
String ifc = tun.getListenOnInterface();
for (int i = 0; i < controllers.size(); i++) { for (int i = 0; i < controllers.size(); i++) {
if (i == tunnel) if (i == tunnel)
continue; continue;
if (port.equals(controllers.get(i).getListenPort())) TunnelController tc = controllers.get(i);
return "<font color=\"red\">" + if (port.equals(tc.getListenPort())) {
_t("Warning - duplicate port") + String ifc2 = tc.getListenOnInterface();
": " + port + "</font>"; if (DataHelper.eq(ifc, ifc2) ||
"0.0.0.0".equals(ifc) ||
"0.0.0.0".equals(ifc2) ||
"0:0:0:0:0:0:0:0".equals(ifc) ||
"0:0:0:0:0:0:0:0".equals(ifc2)) {
return "<font color=\"red\">" +
_t("Warning - duplicate port") +
": " + port + "</font>";
}
}
} }
return port; return port;
} }
......
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