summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB BALAJI SINGH <b_b_singh@dell.com>2016-08-30 03:05:46 -0400
committerZdenek Styblik <stybla@turnovfree.net>2016-08-31 19:34:18 +0200
commit052655cd91e9173e43c4540737d52d031a7a9046 (patch)
treecd126c628e21603a81060a1747c7b48441aa621a
parentfa2c1550b9e36c4ecd6aa27446df34cec56f4001 (diff)
downloadipmitool-052655cd91e9173e43c4540737d52d031a7a9046.tar.gz
ID:456 - Unable to disable the VLAN ID using ipmitool
Currently, when a LAN parameter set command is sent through ipmitool, the corresponding parameter data is requested and compared to the command to verify that the data was written correctly. Since we do send the VLAN ID in this return data, regardless of whether VLAN is disabled or not, this mismatch between requested and received parameters causes ipmitool to retry the command 10 times and return an error. ipmitool is sending "0x00 0x00" reading back data from BMC as "0x01 0x00" which is NOT matching & hence pops up the error /warning "LAN Parameter Data does not match! Write may have failed." After 10 retries when we check "ipmitool lan print" VLAN ID is disabled successfully.
-rw-r--r--lib/ipmi_lanp.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
index 16a3a3e..65d881b 100644
--- a/lib/ipmi_lanp.c
+++ b/lib/ipmi_lanp.c
@@ -1204,12 +1204,27 @@ get_cmdline_ipaddr(char * arg, uint8_t * buf)
static int
ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
+ struct lan_param *p;
uint8_t data[2];
int rc;
if (string == NULL) {
- data[0] = 0;
- data[1] = 0;
+ lprintf(LOG_DEBUG, "Get current VLAN ID from BMC.");
+ p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
+ if (p != NULL && p->data != NULL && p->data_len > 1) {
+ int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
+ if (id < 1 || id > 4094) {
+ lprintf(LOG_ERR,
+ "Retrieved VLAN ID %i is out of range <1..4094>.",
+ id);
+ return (-1);
+ }
+ data[0] = p->data[0];
+ data[1] = p->data[1] & 0x0F;
+ } else {
+ data[0] = 0;
+ data[1] = 0;
+ }
}
else {
int id = 0;