Merge "BUG702: RPC Router fails to acquire IP address of the host"
authorTony Tkacik <ttkacik@cisco.com>
Tue, 15 Apr 2014 07:28:02 +0000 (07:28 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 15 Apr 2014 07:28:02 +0000 (07:28 +0000)
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImpl.java

index 722ca0687904f2c7f2e5c42572fc2d16c762936b..d256b998d4f8abd254fffea087778600a1b70051 100644 (file)
@@ -254,7 +254,6 @@ public class ServerImpl implements RemoteRpcServer {
       e = NetworkInterface.getNetworkInterfaces();
     } catch (SocketException e1) {
       _logger.error("Failed to get list of interfaces", e1);
-      //throw new RuntimeException("Failed to acquire list of interfaces", e1);
       return null;
     }
     while (e.hasMoreElements()) {
@@ -265,7 +264,7 @@ public class ServerImpl implements RemoteRpcServer {
       while (ee.hasMoreElements()) {
         InetAddress i = (InetAddress) ee.nextElement();
         _logger.debug("Trying address {}", i);
-        if ((i instanceof Inet4Address) && (i.isSiteLocalAddress())) {
+        if ((i instanceof Inet4Address) && (!i.isLoopbackAddress())) {
           String hostAddress = i.getHostAddress();
           _logger.debug("Settled on host address {}", hostAddress);
           return hostAddress;