Index: main/acl.c =================================================================== --- main/acl.c (revision 89403) +++ main/acl.c (arbetskopia) @@ -393,6 +393,7 @@ return -1; } close(s); + ast_log(LOG_DEBUG, "Found address for this socket\n"); *us = sin.sin_addr; return 0; } @@ -407,6 +408,7 @@ /* just use the bind address if it is nonzero */ if (ntohl(bindaddr.sin_addr.s_addr)) { memcpy(ourip, &bindaddr.sin_addr, sizeof(*ourip)); + ast_log(LOG_DEBUG, "Attached to given IP address\n"); return 0; } /* try to use our hostname */ @@ -416,12 +418,15 @@ hp = ast_gethostbyname(ourhost, &ahp); if (hp) { memcpy(ourip, hp->h_addr, sizeof(*ourip)); + ast_log(LOG_DEBUG, "Found one IP address based on hostname. What if DNS has multiple records for host name?\n"); return 0; } } + ast_log(LOG_DEBUG, "Trying to connect to A.ROOT-SERVERS.NET and get our IP address for that connection\n"); /* A.ROOT-SERVERS.NET. */ if (inet_aton("198.41.0.4", &saddr) && !ast_ouraddrfor(&saddr, ourip)) return 0; + ast_log(LOG_DEBUG, "Failed to find any IP address for us\n"); return -1; }