### Eclipse Workspace Patch 1.0
#P JGroups
Index: src/org/jgroups/util/StackType.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/util/StackType.java,v
retrieving revision 1.1
diff -u -r1.1 StackType.java
--- src/org/jgroups/util/StackType.java	26 Oct 2009 14:09:47 -0000	1.1
+++ src/org/jgroups/util/StackType.java	9 Apr 2010 19:56:33 -0000
@@ -5,5 +5,5 @@
  * @version $Id: StackType.java,v 1.1 2009/10/26 14:09:47 belaban Exp $
  */
 public enum StackType {
-    IPv4, IPv6, Unknown
+    IPv4, IPv6, Unknown, Either;
 }
Index: src/org/jgroups/util/Util.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/util/Util.java,v
retrieving revision 1.259
diff -u -r1.259 Util.java
--- src/org/jgroups/util/Util.java	25 Mar 2010 17:03:20 -0000	1.259
+++ src/org/jgroups/util/Util.java	9 Apr 2010 19:56:33 -0000
@@ -3327,8 +3327,8 @@
                 InetAddress address = (InetAddress) addresses.nextElement() ;
 
                 // check if we find an address of correct version
-                if ((address instanceof Inet4Address && (ip_version == StackType.IPv4)) ||
-                        (address instanceof Inet6Address && (ip_version == StackType.IPv6))) {
+                if ((address instanceof Inet4Address && (ip_version == StackType.IPv4 || ip_version == StackType.Either)) ||
+                        (address instanceof Inet6Address && (ip_version == StackType.IPv6 || ip_version == StackType.Either))) {
                     supportsVersion = true ;
                     break ;
                 }
@@ -3365,7 +3365,7 @@
                 return StackType.IPv4;
             if(Boolean.getBoolean(Global.IPv6))
                 return StackType.IPv6;
-            return StackType.IPv6;
+            return StackType.Either;
 		}
 		return StackType.Unknown;
     }
Index: src/org/jgroups/stack/Configurator.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/stack/Configurator.java,v
retrieving revision 1.79
diff -u -r1.79 Configurator.java
--- src/org/jgroups/stack/Configurator.java	5 Mar 2010 08:49:19 -0000	1.79
+++ src/org/jgroups/stack/Configurator.java	9 Apr 2010 19:56:33 -0000
@@ -106,10 +106,15 @@
             // Else pass
 
             for(InetAddress addr: addrs) {
-                if(addr instanceof Inet6Address && ip_version == StackType.IPv4)
-                    throw new IllegalArgumentException("found IPv6 address " + addr + " in an IPv4 stack");
-                if(addr instanceof Inet4Address && addr.isMulticastAddress() && ip_version == StackType.IPv6)
-                    throw new Exception("found IPv4 multicast address " + addr + " in an IPv6 stack");
+                if (ip_version == StackType.Unknown) {
+                   ip_version = (addr instanceof Inet6Address) ? StackType.IPv6 : StackType.IPv4;
+                }
+                else {
+                    if(addr instanceof Inet6Address && ip_version == StackType.IPv4)
+                        throw new IllegalArgumentException("found IPv6 address " + addr + " in an IPv4 stack");
+                    if(addr instanceof Inet4Address && addr.isMulticastAddress() && ip_version == StackType.IPv6)
+                        throw new Exception("found IPv4 multicast address " + addr + " in an IPv6 stack");
+                }
             }
         }
 
