[Esbox-commits] r2276 - branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters
eswartz at garage.maemo.org
eswartz at garage.maemo.org
Wed Oct 7 19:56:09 EEST 2009
Author: eswartz
Date: 2009-10-07 19:56:05 +0300 (Wed, 07 Oct 2009)
New Revision: 2276
Modified:
branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java
Log:
One fix for Mica #4648
Modified: branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java 2009-10-07 14:50:40 UTC (rev 2275)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java 2009-10-07 16:56:05 UTC (rev 2276)
@@ -14,11 +14,15 @@
import static org.maemo.mica.internal.api.protocol.sbrsh.SBRSHMachineFactory.createSBRSHMachine;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.maemo.esbox.internal.scratchbox.core.Activator;
import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.NetworkUtils;
import org.maemo.mica.common.core.filesystem.ISharedFilesystemProvider;
import org.maemo.mica.common.core.filesystem.ISharedFolder;
import org.maemo.mica.common.core.machine.IMachine;
@@ -289,8 +293,6 @@
if (buildMachine instanceof ISSHMachine) {
hostAddress = ((ISSHMachine) deviceTarget.getMachine())
.getSshConfiguration().getHostAddress();
- String ts = ((ISSHMachine) deviceTarget.getMachine())
- .getSshConfiguration().getTargetAddress();
ISSHMachine buildMachine = (ISSHMachine) this.buildMachine;
@@ -302,10 +304,15 @@
// if device tries to access the local machine on the same
// network of build machine
if (hostAddress.equals(machineHostingESboxIP)) {
- hostAddress = esboxBuildMachineIP; // switch to ESbox Build
- // Machine address
- // In the case of a Virtual machine, this only works if
- // the user rightly configured the Bridge Network
+ try {
+ if (!NetworkUtils.isLocalAddress(InetAddress.getByName(esboxBuildMachineIP)))
+ hostAddress = esboxBuildMachineIP;
+ // switch to ESbox Build Machine address
+ // In the case of a Virtual machine, this only works if
+ // the user rightly configured the Bridge Network
+ } catch (UnknownHostException e) {
+ hostAddress = esboxBuildMachineIP;
+ }
}
} else {
hostAddress = ((ISSHMachine) deviceTarget.getMachine())
More information about the Esbox-commits
mailing list