From b38f0378a5388493cd19d89dc8f0104561637da2 Mon Sep 17 00:00:00 2001 From: ligc Date: Sat, 12 Jun 2010 08:11:17 +0000 Subject: [PATCH] pping support for IPv6 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6448 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/pping | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/pping b/xCAT-client/bin/pping index 364bb9fd5..16b57c8ee 100755 --- a/xCAT-client/bin/pping +++ b/xCAT-client/bin/pping @@ -130,7 +130,21 @@ foreach my $interf (@interfaces) { sub fping_pping { my $nodes = shift; - open (FPING, "fping ".join(' ',@$nodes). " 2>&1 |") or die("Cannot open fping pipe: $!"); + my $master = xCAT::Utils->get_site_Master(); + my $masterip = xCAT::NetworkUtils->getipaddr($master); + if ($masterip =~ /:/) #IPv6, needs fping6 support + { + if (!-x '/usr/bin/fping6') + { + print "fping6 is not availabe for IPv6 ping.\n"; + exit 1; + } + open (FPING, "fping6 ".join(' ',@$nodes). " 2>&1 |") or die("Cannot open fping pipe: $!"); + } + else + { + open (FPING, "fping ".join(' ',@$nodes). " 2>&1 |") or die("Cannot open fping pipe: $!"); + } while () { if ($_ =~ /is unreachable/) { s/ is unreachable/: noping/;