Dan Gora
2013-03-22 00:12:53 UTC
This code was moved to ipmi_main.c from open.c and in the change a bug
was introduced where the PICMG Get Device Locator command would not
be run unless the user explicitly set my_addr to 0 with the -m command.
The more sensible thing to do is to run this unless the user explictly
overrides it with the -m option.
Signed-off-by: Dan Gora <***@adax.com>
---
ipmitool/lib/ipmi_main.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/ipmitool/lib/ipmi_main.c b/ipmitool/lib/ipmi_main.c
index ce98ef4..a2f3500 100644
--- a/ipmitool/lib/ipmi_main.c
+++ b/ipmitool/lib/ipmi_main.c
@@ -363,7 +363,7 @@ ipmi_main(int argc, char ** argv,
uint8_t transit_addr = 0;
uint8_t transit_channel = 0;
uint8_t target_lun = 0;
- uint8_t my_addr = 0x20;
+ uint8_t my_addr = 0;
uint16_t my_long_packet_size=0;
uint8_t my_long_packet_set=0;
uint8_t lookupbit = 0x10; /* use name-only lookup by default */
@@ -854,6 +854,9 @@ ipmi_main(int argc, char ** argv,
if (my_addr) {
ipmi_main_intf->my_addr = my_addr;
} else {
+ /* Use the default for the payload source address */
+ my_addr = 0x20;
+
/* Check if PICMG extension is available to use the function
* GetDeviceLocator to retreive i2c address PICMG hack to set
* right IPMB address, If extension is not supported, should
@@ -861,7 +864,6 @@ ipmi_main(int argc, char ** argv,
* PICMG Extension Version 2.0 (PICMG 3.0 Revision 1.0 ATCA) to
* PICMG Extension Version 2.3 (PICMG 3.0 Revision 3.0 ATCA)
*/
-
/* First, check if PICMG extension is available and supported */
struct ipmi_rq req;
struct ipmi_rs *rsp;
@@ -880,10 +882,12 @@ ipmi_main(int argc, char ** argv,
rsp = ipmi_main_intf->sendrecv(ipmi_main_intf, &req);
if (rsp && !rsp->ccode) {
if ( (rsp->data[0] == 0) &&
- ((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION) ) {
+ ((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION)){
version_accepted = 1;
- lprintf(LOG_INFO, "Discovered PICMG Extension %d.%d",
- (rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
+ lprintf(LOG_INFO,
+ "Discovered PICMG Extension %d.%d",
+ (rsp->data[1] & 0x0f),
+ (rsp->data[1] >> 4));
}
}
was introduced where the PICMG Get Device Locator command would not
be run unless the user explicitly set my_addr to 0 with the -m command.
The more sensible thing to do is to run this unless the user explictly
overrides it with the -m option.
Signed-off-by: Dan Gora <***@adax.com>
---
ipmitool/lib/ipmi_main.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/ipmitool/lib/ipmi_main.c b/ipmitool/lib/ipmi_main.c
index ce98ef4..a2f3500 100644
--- a/ipmitool/lib/ipmi_main.c
+++ b/ipmitool/lib/ipmi_main.c
@@ -363,7 +363,7 @@ ipmi_main(int argc, char ** argv,
uint8_t transit_addr = 0;
uint8_t transit_channel = 0;
uint8_t target_lun = 0;
- uint8_t my_addr = 0x20;
+ uint8_t my_addr = 0;
uint16_t my_long_packet_size=0;
uint8_t my_long_packet_set=0;
uint8_t lookupbit = 0x10; /* use name-only lookup by default */
@@ -854,6 +854,9 @@ ipmi_main(int argc, char ** argv,
if (my_addr) {
ipmi_main_intf->my_addr = my_addr;
} else {
+ /* Use the default for the payload source address */
+ my_addr = 0x20;
+
/* Check if PICMG extension is available to use the function
* GetDeviceLocator to retreive i2c address PICMG hack to set
* right IPMB address, If extension is not supported, should
@@ -861,7 +864,6 @@ ipmi_main(int argc, char ** argv,
* PICMG Extension Version 2.0 (PICMG 3.0 Revision 1.0 ATCA) to
* PICMG Extension Version 2.3 (PICMG 3.0 Revision 3.0 ATCA)
*/
-
/* First, check if PICMG extension is available and supported */
struct ipmi_rq req;
struct ipmi_rs *rsp;
@@ -880,10 +882,12 @@ ipmi_main(int argc, char ** argv,
rsp = ipmi_main_intf->sendrecv(ipmi_main_intf, &req);
if (rsp && !rsp->ccode) {
if ( (rsp->data[0] == 0) &&
- ((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION) ) {
+ ((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION)){
version_accepted = 1;
- lprintf(LOG_INFO, "Discovered PICMG Extension %d.%d",
- (rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
+ lprintf(LOG_INFO,
+ "Discovered PICMG Extension %d.%d",
+ (rsp->data[1] & 0x0f),
+ (rsp->data[1] >> 4));
}
}
--
1.7.7
1.7.7