From 2afb7d32d1b6c6b2d1e7528522daa61746de27ab Mon Sep 17 00:00:00 2001 From: yinle Date: Sun, 20 May 2012 09:07:26 +0000 Subject: [PATCH] Fix bug 3527493:lsslp return incompete object information git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12833 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/SLP.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/SLP.pm b/perl-xCAT/xCAT/SLP.pm index 12aea2662..4fde746c7 100644 --- a/perl-xCAT/xCAT/SLP.pm +++ b/perl-xCAT/xCAT/SLP.pm @@ -16,6 +16,7 @@ unless ($ip6support) { #TODO: somehow get at system headers to get the value, put in linux's for now use constant IPV6_MULTICAST_IF => 17; use constant IP_MULTICAST_IF => 32; +use constant REQ_INTERVAL => 1; my %xid_to_srvtype_map; my $xid; my $gprlist; @@ -85,7 +86,10 @@ sub dodiscover { $waitforsocket->add($args{'socket'}); my $retrytime = ($args{Retry}>0)?$args{Retry}+1:1; for(my $i = 0; $i < $retrytime; $i++){ - my $waittime = ($args{Time}>0)?$args{Time}:3; + my $sendcount = 0; + my $startinterval = time(); + my $interval; + my $waittime = ($args{Time}>0)?$args{Time}:10; my $deadline=time()+$waittime; while ($deadline > time()) { while ($waitforsocket->can_read(1)) { @@ -132,9 +136,14 @@ sub dodiscover { last; } } - foreach my $srvtype (@srvtypes) { - send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype); - } + $interval = time() - $startinterval; + if ( $interval > REQ_INTERVAL ){#* (2**$sendcount))) { #double time + $sendcount++; + $startinterval = time(); + foreach my $srvtype (@srvtypes) { + send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype); + } + } } } return \%rethash;