private void checkForIPv6() throws Exception {
    boolean preferIpV6Addr = Boolean.getBoolean("java.net.preferIPv6Addresses");
    if (!preferIpV6Addr) {
      if (logger.isDebugEnabled()) {
        logger
            .debug("forcing JGroups to think IPv4 is being used so it will choose an IPv4 address");
      }
      Field m = org.jgroups.util.Util.class.getDeclaredField("ip_stack_type");
      m.setAccessible(true);
      m.set(null, org.jgroups.util.StackType.IPv4);
    }
  }
JGroups picks an IPv6 address if preferIPv4Stack is false or not set and preferIPv6Addresses is
not set or is true. We want it to use an IPv4 address for a dual-IP stack so that both IPv4 and
IPv6 messaging work
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java