mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-29 15:36:13 +00:00
Fix trivial bug in ooSocket.c codes
Revert condition for result code of ast_gethostbyname (closes issue #19185) Reported by: dswartz Patches: issue19185-patch uploaded by may213 (license 454) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316874 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -522,10 +522,10 @@ int ooGetLocalIPAddress(char * pIPAddrs)
|
|||||||
ret = gethostname(hostname, 100);
|
ret = gethostname(hostname, 100);
|
||||||
if(ret == 0)
|
if(ret == 0)
|
||||||
{
|
{
|
||||||
if (!(hp = ast_gethostbyname(hostname, &phost))) {
|
if ((hp = ast_gethostbyname(hostname, &phost))) {
|
||||||
struct in_addr i;
|
struct in_addr i;
|
||||||
memcpy(&i, hp->h_addr, sizeof(i));
|
memcpy(&i, hp->h_addr, sizeof(i));
|
||||||
strcpy(pIPAddrs, (ast_inet_ntoa(i) == NULL) ? "127.0.0.1" : ast_inet_ntoa(i));
|
strcpy(pIPAddrs, (ast_inet_ntoa(i) == NULL) ? "127.0.0.1" : ast_inet_ntoa(i));
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user