Here is the full patch that includes my previous patch and reverts
ipmi_sol.c to 1.46 to work in the more well-tested (and working with IBM
BMCs) way, but not screw up when SOL data comes during get device id
keepalive. I decided to package it all up and send it since ipmitool
cvs hasn't appeared to revert ipmi_sol.c change or modify lanplus.c.
Without this SOL from current CVS is atrocious on afflicted systems
(pausing many seconds every 30 seconds), and downed connections seem not
to be automatically detected (which is another bug that I haven't
bothered to look at, but would be closer with the keepalive failure
closing things down).
Applying this against CVS gets an ipmitool that achieves what 1.47 was
trying to do without the compromise, I think and my testing has shown.
Would like to see it committed and hear feedback from Jean-Michel Audet
as to whether it is agreed that this is a valid solution.
diff -ur ipmitool/lib/ipmi_sol.c ipmitool-solcorrection/lib/ipmi_sol.c
--- ipmitool/lib/ipmi_sol.c 2006-11-14 11:08:55.000000000 -0500
+++ ipmitool-solcorrection/lib/ipmi_sol.c 2006-12-20 17:31:12.000000000 -0500
@@ -1367,13 +1367,11 @@
return retval;
}
+
static int
-ipmi_sol_keepalive_using_sol(struct ipmi_intf * intf)
+ipmi_sol_keepalive(struct ipmi_intf * intf)
{
- struct ipmi_v2_payload v2_payload;
- struct ipmi_rs * rsp = NULL;
struct timeval end;
-
int ret = 0;
if (_disable_keepalive)
@@ -1382,14 +1380,10 @@
gettimeofday(&end, 0);
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
- memset(&v2_payload, 0, sizeof(v2_payload));
-
- v2_payload.payload.sol_packet.character_count = 0;
-
- rsp = intf->send_sol(intf, &v2_payload);
-
+ ret = intf->keepalive(intf);
gettimeofday(&_start_keepalive, 0);
- }
+ }
+
return ret;
}
@@ -1412,7 +1406,7 @@
buffer = (char*)malloc(buffer_size);
if (buffer == NULL) {
- lprintf(LOG_ERR, "ipmitool: malloc failure");
+ lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -1428,7 +1422,7 @@
FD_SET(intf->fd, &read_fds);
/* Send periodic keepalive packet */
- keepAliveRet = ipmi_sol_keepalive_using_sol(intf);
+ keepAliveRet = ipmi_sol_keepalive(intf);
if (keepAliveRet != 0)
{
/* no response to keepalive message */
diff -ur ipmitool/src/plugins/lanplus/lanplus.c ipmitool-solcorrection/src/plugins/lanplus/lanplus.c
--- ipmitool/src/plugins/lanplus/lanplus.c 2006-11-22 09:28:39.000000000 -0500
+++ ipmitool-solcorrection/src/plugins/lanplus/lanplus.c 2006-12-20 17:31:55.000000000 -0500
@@ -3459,6 +3459,17 @@
return 0;
rsp = intf->sendrecv(intf, &req);
+ while (rsp != NULL && is_sol_packet(rsp)) {
+ /* rsp was SOL data instead of our answer */
+ /* since it didn't go through the sol recv, do sol recv stuff here */
+ ack_sol_packet(intf, rsp);
+ check_sol_packet_for_new_data(intf, rsp);
+ if (rsp->data_len)
+ intf->session->sol_data.sol_input_handler(rsp);
+ rsp = ipmi_lan_poll_recv(intf);
+ if (rsp == NULL) /* the get device id answer never got back, but retry mechanism was bypassed by SOL data */
+ return 0; /* so get device id command never returned, the connection is still alive */
+ }
if (rsp == NULL)
return -1;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel