> If we receive incomplete or corrupted packet, parsing (i.e. lesser or
> greater bytes) would lead to memory faults. It is safer to drop the
> packet instead. 

There is a difference between a "corrupted" packet and a "shortened"
packet.  Having a packet < the expected length of the response is a in
fact a normal condition. For example if you pass a bad username in a get
session challenge packet, the BMC responds with a shortened packet with
a bad comp-code.  

I handle this condition in unassemble_ipmi_lan_pkt() and
fiid_obj_dump_lan().

Al

--
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory


----- Original Message -----
From: Anand Babu <[EMAIL PROTECTED]>
Date: Thursday, February 2, 2006 3:37 pm
Subject: Re: UDM error codes

> ,----[ Albert Chu <[EMAIL PROTECTED]> ]
> | Hi guys,
> | Can the UDM-LAN interface return error codes back to the user?  As
> | far as I can tell, it can't.
> | 
> | In unassemble_ipmi_lan_pkt2() there is:
> | 
> |   if (pkt_len != lan_packet_length)
> |     {
> |       free (tmpl_lan_packet);
> |       return (-1);
> |     }
> | 
> | So if the packet is an "incorrect" length, an error code won't be
> | parsed and returned.
> `----
> If we receive incomplete or corrupted packet, parsing (i.e. lesser or
> greater bytes) would lead to memory faults. It is safer to drop the
> packet instead. 
> 
> Currently ipmi_lan_cmd2 checks for < or > length cases and reports to
> STDERR stream to user to report to freeipmi-devel(at)gnu.org mailing
> list. unassemble is called only in case of proper length. You may also
> notice.
> 
> Also look at the recently introduced way to pass error messages. 
> ipmi_device_t has a field "errmsg[IPMI_ERR_STR_MAX_LEN]" to hold a
> more detailed latest error string. If return codes are -1, high level
> calls can use this string, instead of less informative "errno".
> 
> -- 
> Anand Babu 
> GPG Key ID: 0x62E15A31
> Blog [http://ab.freeshell.org]              
> The GNU Operating System [http://www.gnu.org]  
> 
> Z RESEARCH [http://www.zresearch.com] 
> A Supercomputing Company.
> 
> 



_______________________________________________
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel

Reply via email to