summaryrefslogtreecommitdiff
path: root/util/ipmilan.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/ipmilan.c')
-rw-r--r--util/ipmilan.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/util/ipmilan.c b/util/ipmilan.c
index 814092e..1f5b949 100644
--- a/util/ipmilan.c
+++ b/util/ipmilan.c
@@ -85,7 +85,7 @@ typedef unsigned int socklen_t;
#include <stdlib.h>
#undef HAVE_LANPLUS
-#else /* Linux */
+#else /* Linux, BSD, etc. */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -103,8 +103,12 @@ typedef unsigned int socklen_t;
#include <sys/time.h>
#include <time.h>
#include <signal.h>
+#ifdef HPUX
+#define RECV_MSG_FLAGS 0x40 /*match MSG_WAITALL for HPUX*/
+#else
#define RECV_MSG_FLAGS MSG_WAITALL
#endif
+#endif
#include "ipmicmd.h"
#include "ipmilan.h"
@@ -638,8 +642,11 @@ int open_sockfd(char *node, int port, SockType *sfd, SOCKADDR_T *daddr,
fprintf(fperr,"lan, gethostbyname(%s): errno=%d\n", node,get_errno());
#elif SOLARIS
fprintf(fperr,"lan, gethostbyname(%s): errno=%d\n", node,get_errno());
+#elif defined(HPUX)
+ /*added by ugene */
+ fprintf(fperr,"lan, gethostbyname(%s): errno=%d\n", node,errno);
#else
- fprintf(fperr,"lan, gethostbyname(%s): %s\n", node,hstrerror(errno));
+ fprintf(fperr,"lan, gethostbyname(%s): %s\n", node,hstrerror(errno));
#endif
}
close_sockfd(_sockfd);
@@ -1426,7 +1433,14 @@ static int ipmilan_open_session(SockType sfd, struct sockaddr *destaddr,
fprintf(fpdbg,"GetChanAuth reports only v2 capability\n");
rv = LAN_ERR_V2; /*try v2 instead*/
goto ERREXIT;
- }
+ } else {
+ /* Always switch to IPMI LAN 2.0 if detected. */
+ /* This avoids errors from Dell & Huawei firmware */
+ if (fdebuglan)
+ fprintf(fpdbg,"GetChanAuth detected v2, so switch to v2\n");
+ rv = LAN_ERR_V2; /*use v2 instead*/
+ goto ERREXIT;
+ }
}
/* Check authentication support */
imsgauth = rbuf[3];