[Home]

Summary:ASTERISK-17171: [patch] Each time a device sends a REGISTER, the error "No address associated with nodename" appears
Reporter:John Covert (jcovert)Labels:patch
Date Opened:2010-12-28 10:47:33.000-0600Date Closed:2021-08-11 10:33:23
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Core/Netsock
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) addr.c
( 1) netsock2.c.2011-01-13.patch
( 2) netsock2.c.patch
Description:The following messages appear continuously:

{noformat}
sip_uri_domain_cmp sip.covert.org - sip.covert.org
[Dec 28 10:59:23] ERROR[13395]: netsock2.c:205 ast_sockaddr_parse: getaddrinfo("sip.covert.org", "(null)", ...): No address associated with nodename
[Dec 28 10:59:23] ERROR[13395]: netsock2.c:205 ast_sockaddr_parse: getaddrinfo("sip.covert.org", "(null)", ...): No address associated with nodename
{noformat}

This is because "If the AI_NUMERICHOST bit is set in the ai_flags member of the hints structure, then a non-NULL nodename string must be a numeric host address string. Otherwise an error of EAI_NONAME is returned. This flag prevents any type of name resolution service (e.g., the DNS) from being called."

See http://www.manpages.info/macosx/getaddrinfo.3.html

Patch supplied to eliminate the message on Darwin.

****** STEPS TO REPRODUCE ******

simply allow devices to register which have specified a hostname.
Comments:By: John Covert (jcovert) 2011-01-11 20:53:55.000-0600

Anyone else out there to test this along with me so that it can progress to a check-in?

By: Walter Doekes (wdoekes) 2011-01-12 03:57:37.000-0600

You mean that on Darwin, it returns EAI_NODATA instead of EAI_NONAME when a non-numeric host is passed, right?

EAI_NODATA
No address associated with nodename.
EAI_NONAME
nodename nor servname provided, or not known.

Whereas on e.g. Linux it returns EAI_NONAME. (If _GNU_SOURCE is defined, there is a EAI_NODATA, but it is not returned for the AI_NUMERICHOST reason.)

You'll probably want to change that to:

if (
#ifdef darwin
e != EAI_NODATA
#else
e != EAI_NONAME
#endif
) {

or something..

By: John Covert (jcovert) 2011-01-12 11:14:09.000-0600

>You mean that...

I did a cut and pasted from a document which appears to be wrong.  I have modified my patch per your suggestion and tested it on Darwin/Mac OS X 10.4.11.

Any other Darwin testers out there?

By: John Covert (jcovert) 2011-02-16 19:48:09.000-0600

What is still needed to get this committed?

By: John Covert (jcovert) 2011-04-06 17:46:55

ping.

By: Sean Bright (seanbright) 2021-08-11 10:33:24.055-0500

Modern versions of macOS (and FreeBSD) now return {{EAI_NONAME}} instead of {{EAI_NODATA}}, so this patch is no longer applicable.