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:41 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:41 +0100
commitee6c7128ed0d58cb1812049463a13bba9cfb31b7 (patch)
tree39b80b4d29c70262a7a6f3443e4acb6bd592b287 /util/ipmilan.c
parentb18f5bf2db0fba2e7e539f68645836036d940d26 (diff)
Imported Upstream version 2.9.7upstream/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];