From 3d5b2a62fbad7b6fdd6a43a2f654d675c2de479a Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 05 Jul 2011 16:11:32 +0000
Subject: [PATCH] Fix OPENDJ-244: Replication fails when replication server is configured for a network interface which is not an alias of localhost/127.0.0.1

---
 opends/src/server/org/opends/server/replication/service/ReplicationBroker.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
index 860c365..0ed1b10 100644
--- a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
+++ b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -32,6 +32,7 @@
 import static org.opends.server.loggers.ErrorLogger.logError;
 import static org.opends.server.loggers.debug.DebugLogger.getTracer;
 import static org.opends.server.util.StaticUtils.collectionToString;
+import static org.opends.server.util.StaticUtils.isLocalAddress;
 import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
 
 import java.io.IOException;
@@ -390,7 +391,7 @@
     InetAddress[] rs1Addresses = null;
     try
     {
-      if (rs1.equals("localhost") || rs1.equals("127.0.0.1"))
+      if (isLocalAddress(rs1))
       {
         // Replace localhost with the local official hostname
         rs1 = InetAddress.getLocalHost().getHostName();
@@ -406,7 +407,7 @@
     InetAddress[] rs2Addresses = null;
     try
     {
-      if (rs2.equals("localhost") || rs2.equals("127.0.0.1"))
+      if (isLocalAddress(rs1))
       {
         // Replace localhost with the local official hostname
         rs2 = InetAddress.getLocalHost().getHostName();

--
Gitblit v1.10.0