summaryrefslogtreecommitdiff
path: root/util/ipmilan.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:44 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:44 +0100
commit7551a684bcbc7de7ac3d2e52eea0f9f812affd18 (patch)
tree469d3c40a1c88fcb3ec208a820f7a0fa93dca81c /util/ipmilan.c
parentc71717661b7ee871e5bc957f314ad8779e85abc6 (diff)
parentee6c7128ed0d58cb1812049463a13bba9cfb31b7 (diff)
Merge tag 'upstream/2.9.7'
Upstream version 2.9.7
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];