mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID:347 - Incorrect reserved channel number
Fix validation of IPMI channel numbers according to IPMIv2.0 rev1.1 and update documentation as well.
This commit is contained in:
parent
dd4cab8153
commit
7cd86aaf1e
10
lib/helper.c
10
lib/helper.c
@ -700,9 +700,9 @@ is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr)
|
|||||||
/* is_ipmi_channel_num - wrapper for str-2-int Channel conversion. Message is
|
/* is_ipmi_channel_num - wrapper for str-2-int Channel conversion. Message is
|
||||||
* printed on error.
|
* printed on error.
|
||||||
*
|
*
|
||||||
* 6.3 Channel Numbers, p. 45, IPMIv2 spec.
|
* 6.3 Channel Numbers, p. 49, IPMIv2 spec. rev1.1
|
||||||
* Valid channel numbers are: <0..7>, <E-F>
|
* Valid channel numbers are: <0x0..0xB>, <0xE-0xF>
|
||||||
* Reserved channel numbers: <8-D>
|
* Reserved channel numbers: <0xC-0xD>
|
||||||
*
|
*
|
||||||
* @argv_ptr: source string to convert from; usually argv
|
* @argv_ptr: source string to convert from; usually argv
|
||||||
* @channel_ptr: pointer where to store result
|
* @channel_ptr: pointer where to store result
|
||||||
@ -719,14 +719,14 @@ is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if ((str2uchar(argv_ptr, channel_ptr) == 0)
|
if ((str2uchar(argv_ptr, channel_ptr) == 0)
|
||||||
&& ((*channel_ptr >= 0x0 && *channel_ptr <= 0x7)
|
&& ((*channel_ptr >= 0x0 && *channel_ptr <= 0xB)
|
||||||
|| (*channel_ptr >= 0xE && *channel_ptr <= 0xF))) {
|
|| (*channel_ptr >= 0xE && *channel_ptr <= 0xF))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
lprintf(LOG_ERR,
|
lprintf(LOG_ERR,
|
||||||
"Given Channel number '%s' is either invalid or out of range.",
|
"Given Channel number '%s' is either invalid or out of range.",
|
||||||
argv_ptr);
|
argv_ptr);
|
||||||
lprintf(LOG_ERR, "Channel number must be from ranges: <0..7>, <0xE..0xF>");
|
lprintf(LOG_ERR, "Channel number must be from ranges: <0x0..0xB>, <0xE..0xF>");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user