From 668c479ef6f78ce013a0f0b761af449d4a100a58 Mon Sep 17 00:00:00 2001
From: Julien Duponchelle <julien@gns3.net>
Date: Tue, 13 Dec 2016 16:46:09 +0100
Subject: [PATCH] Temporary fix for tunnel binding for Daniel from SWI

---
 gns3server/controller/compute.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py
index da720c20..ced6789b 100644
--- a/gns3server/controller/compute.py
+++ b/gns3server/controller/compute.py
@@ -594,6 +594,10 @@ class Compute:
         if other_compute == self:
             return (self.host_ip, self.host_ip)
 
+        # Perhaps the user has correct network gateway, we trust him
+        if (self.host_ip not in ('0.0.0.0', '127.0.0.1') and other_compute.host_ip not in ('0.0.0.0', '127.0.0.1')):
+            return (self.host_ip, other_compute.host_ip)
+
         this_compute_interfaces = yield from self.interfaces()
         other_compute_interfaces = yield from other_compute.interfaces()
 
@@ -624,7 +628,4 @@ class Compute:
                 if this_network.overlaps(other_network):
                     return (this_interface["ip_address"], other_interface["ip_address"])
 
-        # Perhaps the user has correct network gateway
-        if (self.host_ip not in ('0.0.0.0', '127.0.0.1') and other_compute.host_ip not in ('0.0.0.0', '127.0.0.1')):
-            return (self.host_ip, other_compute.host_ip)
         raise ValueError("No common subnet for compute {} and {}".format(self.name, other_compute.name))