Hi

Here is a patch against openipmi master branch, that fixes error handling 
in auth_cap_done() routine, making it in line with other similar routines.

Without this patch, in case of connection timeout, application gets call to 
connection callback with err set to EINVAL, that is not describtive and 
can't be properly handled.

Nikita Yushchenko
From 9b432d2ce5d626320fa405e26b901b82d1ecdfe7 Mon Sep 17 00:00:00 2001
From: Nikita Yushchenko <[email protected]>
Date: Tue, 27 Aug 2013 14:50:43 +0400
Subject: [PATCH] ipmi_lan: auth_cap_done(): do not hide error completion code under EINVAL

This change is needed to allow software using library to see "connection
timeout" error, that happens when BMC indeed does not respond.

Signed-off-by: Nikita Yushchenko <[email protected]>
---
 lib/ipmi_lan.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/ipmi_lan.c b/lib/ipmi_lan.c
index 422b96a..239f37b 100644
--- a/lib/ipmi_lan.c
+++ b/lib/ipmi_lan.c
@@ -4950,7 +4950,12 @@ auth_cap_done(ipmi_con_t *ipmi, ipmi_msgi_t *rspi)
 
     lan = (lan_data_t *) ipmi->con_data;
 
-    if ((msg->data[0] != 0) || (msg->data_len < 9)) {
+    if (msg->data[0] != 0) {
+        handle_connected(ipmi, IPMI_IPMI_ERR_VAL(msg->data[0]), addr_num);
+	goto out;
+    }
+
+    if (msg->data_len < 9) {
 	handle_connected(ipmi, EINVAL, addr_num);
 	goto out;
     }
-- 
1.7.2.5

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to