From ccf5e0cb2b64121fb094f3fd785624a0180a9b70 Mon Sep 17 00:00:00 2001 From: nott Date: Wed, 22 Apr 2009 17:18:06 +0000 Subject: [PATCH] Handle case where site domain is not set git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3242 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index b7e5fb779..d34d6a794 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -595,7 +595,15 @@ if ($inet6support) { unless ($peerhost) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); } $peerfqdn=$peerhost; - $peerhost =~ s/\.$domain\.*$//; + + if ($domain) { + # strip off domain if set + $peerhost =~ s/\.$domain\.*$//; + } else { + # otherwise just strip off whatever comes after the first dot + $peerhost =~ s/^.*?\.//; + } + $peerhost =~ s/-eth\d*$//; $peerhost =~ s/-myri\d*$//; $peerhost =~ s/-ib\d*$//;