Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2010-07-15 21:02:42 -0400
committereutarass2010-07-15 21:02:42 -0400
commit8c333e09597760d50afa52e1b03d20fe3be8b148 (patch)
tree2193cd598904d0b6dd54d43c4adeae29fa797a7d /plugins/org.eclipse.tm.tcf.core
parentbba01b255c155ee34c28e151934bdcd009dfbbb9 (diff)
downloadorg.eclipse.tcf-8c333e09597760d50afa52e1b03d20fe3be8b148.tar.gz
org.eclipse.tcf-8c333e09597760d50afa52e1b03d20fe3be8b148.tar.xz
org.eclipse.tcf-8c333e09597760d50afa52e1b03d20fe3be8b148.zip
Workaround for: Java 1.6.0 on Linux returns network prefix == 0 for loop-back interface
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.core')
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java
index 21ec0fb62..3faf2891c 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/LocatorService.java
@@ -602,6 +602,15 @@ public class LocatorService implements ILocator {
}
*/
+ if (network_prefix_len == 0 && address instanceof Inet4Address) {
+ // Java 1.6.0 on Linux returns network prefix == 0 for loop-back interface
+ byte[] buf = address.getAddress();
+ if (buf[0] == 127) {
+ network_prefix_len = 8;
+ if (broadcast == null) broadcast = address;
+ }
+ }
+
if (network_prefix_len > 0 && address != null && broadcast != null) {
set.add(new SubNet(network_prefix_len, address, broadcast));
}

Back to the top