From 696ffeb0236a8d4a73c714d16a5f36ddf627c5fe Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 6 Feb 2017 13:59:41 +0800 Subject: [PATCH] fix issue [DEV]"xcatd: install monitor" process(listening on ipv6 socket) will die on status update from node failed on reverse dns lookup #2459 --- xCAT-server/sbin/xcatd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 99be4bef5..2c60aec14 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -395,9 +395,12 @@ sub do_installm_service { ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET); } unless ($client_name) { - my $myaddr = inet_ntoa($conn->peeraddr); + my $addrfamily=sockaddr_family(getpeername($conn)); + my $myaddr=Socket::inet_ntop($addrfamily,$conn->peeraddr); xCAT::MsgUtils->message("S", "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored"); print "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored\n"; + close($conn); + next; } $clients[0] = $client_name;