Dont use gethostbyname2() at all since it is non-portable,
use gethostbyname() instead.
This commit is contained in:
@@ -19,7 +19,6 @@ ldconfig="ldconfig"
|
|||||||
|
|
||||||
case `uname` in
|
case `uname` in
|
||||||
Linux*)
|
Linux*)
|
||||||
AC_DEFINE(HAVE_GETHOSTBYNAME2,1,[Whether we have gethostbyname2 or not])
|
|
||||||
;;
|
;;
|
||||||
AIX*)
|
AIX*)
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -84,11 +84,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
|
|||||||
if (inet_pton(AF_INET, addr, &sin->sin_addr) != 1) {
|
if (inet_pton(AF_INET, addr, &sin->sin_addr) != 1) {
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
|
|
||||||
#ifdef HAVE_GETHOSTBYNAME2
|
|
||||||
he = gethostbyname2(addr, AF_INET);
|
|
||||||
#else
|
|
||||||
he = gethostbyname(addr);
|
he = gethostbyname(addr);
|
||||||
#endif
|
|
||||||
if (he == NULL) {
|
if (he == NULL) {
|
||||||
iscsi_set_error(iscsi, "Invalid target:%s "
|
iscsi_set_error(iscsi, "Invalid target:%s "
|
||||||
"Failed to resolve hostname.", addr);
|
"Failed to resolve hostname.", addr);
|
||||||
|
|||||||
Reference in New Issue
Block a user