Azeez,

Do you want to add a check for IPv6 version of the 127.0.* as well?

thanks,
dims

On 7/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: azeez
Date: Tue Jul 10 08:31:11 2007
New Revision: 554976

URL: http://svn.apache.org/viewvc?view=rev&rev=554976
Log:
If the IP corresponding to the hostname in the /etc/hosts file is mapped to a 
local IP address, we should not allow this node to join the cluster, since this 
node will start adverting its IP address
as 127.0.0.1 or 127.0.1.1 or something, which means that other nodes will not 
be able to communicate with this node.


Modified:
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java?view=diff&rev=554976&r1=554975&r2=554976
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
 Tue Jul 10 08:31:11 2007
@@ -177,6 +177,14 @@
             TribesMembershipListener membershipListener = new 
TribesMembershipListener();
             channel.addMembershipListener(membershipListener);
             channel.start(Channel.DEFAULT);
+            String localHost = TribesUtil.getLocalHost(channel);
+            if (localHost.startsWith("127.0.")) {
+                channel.stop(Channel.DEFAULT);
+                throw new ClusteringFault("Cannot join cluster using IP " + 
localHost +
+                                          ". Please set an IP address other than 
" +
+                                          localHost + " in your /etc/hosts file and 
retry.");
+            }
+
             sender.setChannel(channel);

             if (contextManager != null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to