From a472c382f47fe59d6885b4eae5f780ce83436a7b Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Sun, 7 Jul 2013 15:22:10 +0000 Subject: [PATCH] ID: 254 - Fix retry of authentication capabilities retrieval When lan or lanplus session is being opened, ipmi_get_auth_capabilities_cmd() is called twice. Now that we have -R and -N options it's not necessary to have such weird code, especially with comment ``I'm not sure why we accept a failure for the first call''. Commit for Jan Safranek --- ipmitool/src/plugins/lan/lan.c | 5 +---- ipmitool/src/plugins/lanplus/lanplus.c | 12 +++--------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/ipmitool/src/plugins/lan/lan.c b/ipmitool/src/plugins/lan/lan.c index 3fee95f..9ef251c 100644 --- a/ipmitool/src/plugins/lan/lan.c +++ b/ipmitool/src/plugins/lan/lan.c @@ -1959,10 +1959,7 @@ ipmi_lan_activate_session(struct ipmi_intf * intf) rc = ipmi_get_auth_capabilities_cmd(intf); if (rc < 0) { - sleep(1); - rc = ipmi_get_auth_capabilities_cmd(intf); - if (rc < 0) - goto fail; + goto fail; } rc = ipmi_get_session_challenge_cmd(intf); diff --git a/ipmitool/src/plugins/lanplus/lanplus.c b/ipmitool/src/plugins/lanplus/lanplus.c index 2abbdc4..0323151 100644 --- a/ipmitool/src/plugins/lanplus/lanplus.c +++ b/ipmitool/src/plugins/lanplus/lanplus.c @@ -3414,18 +3414,12 @@ ipmi_lanplus_open(struct ipmi_intf * intf) /* * * Make sure the BMC supports IPMI v2 / RMCP+ - * - * I'm not sure why we accept a failure for the first call */ if (!ipmi_oem_active(intf, "i82571spt") && ipmi_get_auth_capabilities_cmd(intf, &auth_cap)) { - sleep(1); - if (ipmi_get_auth_capabilities_cmd(intf, &auth_cap)); - { - lprintf(LOG_INFO, "Error issuing Get Channel " - "Authentication Capabilies request"); - goto fail; - } + lprintf(LOG_INFO, "Error issuing Get Channel " + "Authentication Capabilies request"); + goto fail; } if (!ipmi_oem_active(intf, "i82571spt") && ! auth_cap.v20_data_available)