diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 775583368..a11d52f67 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -682,9 +682,14 @@ sub handle_ipmi_packet { if ($rsp[5] & 0b10000000) { $encrypted = 1; } + +#------------------------modified to support openbmc ipmi command---------------- unless ($rsp[5] & 0b01000000) { - return 3; #we refuse to examine unauthenticated packets in this context + if ($self->{max_privilege} != 0) { + return 3; #we refuse to examine unauthenticated packets in this context + } } + splice(@rsp, 0, 4); #ditch the rmcp header my @authcode = splice(@rsp, -12); #strip away authcode and remember it my @expectedcode = unpack("C*", hmac_sha1(pack("C*", @rsp), $self->{k1})); @@ -766,10 +771,13 @@ sub got_rmcp_response { return 9; } $byte = shift @data; - unless ($byte >= 4) { + + # add $byte == 0 to support openbmc ipmi command + unless ($byte >= 4 or $byte == 0) { $self->{onlogon}->("ERROR: Cannot acquire sufficient privilege", $self->{onlogon_args}); return 9; } + $self->{max_privilege} = $byte if ($byte == 0); splice @data, 0, 5; $self->{pendingsessionid} = [ splice @data, 0, 4 ];