Added checks to the NetBIOS name server config/startup to make sure the server has at least one valid local IP address.

Linux often defaults the local host name to the 127.0.0.1 address which causes problems with name lookups.
(Fixes AR-422)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2361 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-02-13 18:11:33 +00:00
parent 1a0923699a
commit 3f6cff061e
2 changed files with 73 additions and 0 deletions

View File

@@ -1481,6 +1481,21 @@ public class NetBIOSNameServer extends NetworkServer implements Runnable
&& addrs[i].getHostAddress().equals("0.0.0.0") == false)
ipList.add(addrs[i].getAddress());
}
// Check if any addresses were added to the list
if ( ipList.size() == 0)
{
// Log the available IP addresses
logger.error("Failed to get IP address(es) for NetBIOS name");
for ( int i = 0; i < addrs.length; i++)
logger.error( " Address: " + addrs[i]);
logger.error("Check hosts file and/or DNS setup");
logger.error("NetBIOS name server is shutting down");
return;
}
}
// Initialize the NetBIOS name socket