version 1.1.1.1, 2018/04/24 16:37:52
|
version 1.1.1.2, 2018/04/24 16:41:51
|
Line 88 void
|
Line 88 void
|
getouraddr() |
getouraddr() |
{ |
{ |
char buff[256]; |
char buff[256]; |
struct hostent *he; |
struct hostent *he = NULL; |
|
|
if (gethostname(buff,256) < 0) |
if (gethostname(buff,256) == 0) |
return; |
he = gethostbyname(buff); |
|
if (he) |
if ((he = gethostbyname(buff)) == NULL) |
our_addr = *(struct in_addr *)he->h_addr; |
return; |
if (our_addr.s_addr == 0) |
|
our_addr.s_addr = loopback_addr.s_addr; |
our_addr = *(struct in_addr *)he->h_addr; |
|
} |
} |
|
|
#if SIZEOF_CHAR_P == 8 |
#if SIZEOF_CHAR_P == 8 |