summaryrefslogtreecommitdiff
path: root/util/ipmilan.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/ipmilan.c')
-rw-r--r--util/ipmilan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/util/ipmilan.c b/util/ipmilan.c
index 1f5b949..acea438 100644
--- a/util/ipmilan.c
+++ b/util/ipmilan.c
@@ -352,8 +352,10 @@ static uchar g_Cipher[ 16 ][ 16 ]; /*SeedCount x CipherHash for SOL 1.5*/
#ifdef WIN32
int econnrefused = WSAECONNREFUSED; /*=10061.*/
+int econnreset = WSAECONNRESET; /*=10054.*/
#else
int econnrefused = ECONNREFUSED; /*=111. from Linux asm/errno.h */
+int econnreset = ECONNRESET; /*=104.*/
#endif
#ifdef WIN32
@@ -1232,7 +1234,7 @@ static int _send_lan_cmd(SockType s, uchar *pcmd, int scmd, uchar *presp,
fprintf(fpdbg,"ipmilan_cmd timeout, after request, seq=%x itry=%d\n",
phdr->seq_num, itry);
rv = LAN_ERR_RECV_FAIL;
- if (fdopoke2) ipmilan_poke2(s, to, tolen);
+ if (fdopoke2) ipmilan_poke2(s, to, tolen);
os_usleep(0,5000);
continue; /* retry */
}
@@ -1243,14 +1245,15 @@ static int _send_lan_cmd(SockType s, uchar *pcmd, int scmd, uchar *presp,
if (fdebuglan) {
fprintf(fpdbg,"ipmilan_recvfrom rlen=%d, err=%d iseq=%x itry=%d\n",
rlen,lasterr,phdr->iseq_num,itry);
- show_LastError("ipmilan_recvfrom",lasterr);
- }
- rv = rlen; /* -3 = LAN_ERR_RECV_FAIL */
- rlen = 0;
+ show_LastError("ipmilan_recvfrom",lasterr);
+ }
+ rv = rlen; /* -3 = LAN_ERR_RECV_FAIL */
+ rlen = 0;
*sresp = rlen;
/* Sometimes the OS sends an ECONNREFUSED error, but
* retrying will catch the BMC's reply packet. */
if (lasterr == econnrefused) continue; /*try again*/
+ else if (lasterr == econnreset) continue; /*try again*/
else break; /* goto EXIT; */
} else { /* successful receive */
net2h(&phdr->iseq_num,&rbuf[5],4); /*incoming seq_num from hdr*/