My apologies for the previous mail having tag "confidential". please neglect the tag.
>>From: Albert Chu [mailto:ch...@llnl.gov] >>Sent: Monday, August 8, 2016 10:27 PM >>To: Zdenek Styblik <zdenek.styb...@gmail.com> >>Cc: Singh, B B <b_b_si...@dell.com>; ipmitool-devel >><ipmitool-devel@lists.sourceforge.net> >>Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!! >>As a fellow IPMI project maintainer, I would side with the opinion the bug is >>on the BMC. The BMC should not care what the VLAN ID is when it is being >>disabled, only when it's being enabled. >>That said, it would perhaps be nice to get a workaround into ipmitool to deal >>with this. Perhaps nothing more than a "--vlan-id" or something like that >>option to allow the user to override the default. >>Al >Hi Albert, >The issue of validating the VLAN ID during a disable command has been >corrected in the BMC firmware, but there is another incongruency related to >this defect that may cause headaches for ipmitool users. >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: >set_lan_param_wait > if (memcmp(data, p->data, len) != 0) { > sleep(IPMI_LANP_TIMEOUT); > if (retry-- == 0) { > lprintf(LOG_WARNING, "LAN Parameter Data does > not match! " > "Write may have failed."); > return -1; > } > continue; > } >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. >In the interest of resolving this issue for all users of the tool, have made >these below changes in ipmitool. Please review it & let me know the comments. >--- ipmi_lanp.c 2016-08-09 15:29:56.000000000 +0530 >+++ ipmi_lanp_with_changes.c 2016-08-09 15:29:56.000000000 +0530 >@@ -1319,10 +1319,20 @@ >{ > uint8_t data[2]; > int rc; >+ struct lan_param * p; //handling for vlan disable, get the vlan id >before sending > > if (string == NULL) { >- data[0] = 0; >- data[1] = 0; >+ lprintf(LOG_NOTICE, "get vlan id ."); >+ p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID); >+ if (p != NULL && p->data != NULL) { >+ int id = ((p->data[1] & 0x0f) << 8) + p->data[0]; >+ if (id < 1 || id > 4094) { >+ lprintf(LOG_NOTICE, "vlan id retrieved is not >1 and 4094."); >+ return -1; >+ } >+ data[0] = p->data[0]; >+ data[1] = p->data[1]; >+ } > } > else { > int id = 0; >Regards >Balaji Singh ------------------------------------------------------------------------------ _______________________________________________ Ipmitool-devel mailing list Ipmitool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipmitool-devel