Merge a new implementation of ast_inet_ntoa, our thread safe replacement for

inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-07-21 17:31:28 +00:00
parent 1861dcdff5
commit ca9ba719b6
19 changed files with 338 additions and 454 deletions

View File

@@ -7505,7 +7505,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
return -1;
}
memcpy(&ia,hp->h_addr,sizeof(in_addr_t));
ast_inet_ntoa(nodeip,sizeof(nodeip) - 1,ia);
ast_copy_string(nodeip, ast_inet_ntoa(ia), sizeof(nodeip));
if (strcmp(hisip,nodeip))
{
char *s3 = strchr(s1,'@');
@@ -7519,7 +7519,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
return -1;
}
memcpy(&ia,hp->h_addr,sizeof(in_addr_t));
ast_inet_ntoa(nodeip,sizeof(nodeip) - 1,ia);
ast_copy_string(nodeip, ast_inet_ntoa(ia), sizeof(nodeip));
if (strcmp(hisip,nodeip))
{
ast_log(LOG_WARNING, "Node %s IP %s does not match link IP %s!!\n",b1,nodeip,hisip);