From 4018deb485676a67118edd9452ff3b0379ecc057 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 13 Sep 2012 21:01:43 +0000 Subject: [PATCH] Rework IPMI seqlun management to avoid accepting the same data twice as valid instead of retry git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13789 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/IPMI.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 891cb55ae..93fbb6504 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -349,8 +349,6 @@ sub subcmd { my @rnl = ($rsaddr,$args{netfn}<<2); my @rest = ($rqaddr,$self->{seqlun},$args{command},@{$args{data}}); my @payload=(@rnl,$self->checksum(@rnl),@rest,$self->checksum(@rest)); - $self->{seqlun} += 4; #increment by 1<<2 - $self->{seqlun} &= 0xff; #keep it one byte $self->{ipmicallback} = $args{callback}; $self->{ipmicallback_args} = $args{callback_args}; my $type = $payload_types{'ipmi'}; @@ -736,11 +734,13 @@ sub parse_ipmi_payload { my @payload = @_; #for now, just trash the headers, this has been validated to death anyway #except seqlun, that one is important - if ($payload[4] != ($self->{seqlun} ? $self->{seqlun}-4 : 252)) { - print "Successfully didn't get confused by stale response ".$payload[4]." and ".($self->{seqlun}-4)."\n"; + if ($payload[4] != $self->{seqlun}) { + #print "Successfully didn't get confused by stale response ".$payload[4]." and ".($self->{seqlun}-4)."\n"; hexdump(@payload); return 1; #response mismatch } + $self->{seqlun} += 4; #increment by 1<<2 + $self->{seqlun} &= 0xff; #keep it one byte delete $sessions_waiting{$self}; #deregister self as satisfied, callback will reregister if appropriate splice @payload,0,5; #remove rsaddr/netfs/lun/checksum/rq/seq/lun pop @payload; #remove checksum