[Home]

Summary:ASTERISK-26865: chan_iax2: Reload of iax peer results in loss of host address/port
Reporter:Richard Begg (meric)Labels:
Date Opened:2017-03-14 00:10:06Date Closed:2017-03-15 22:04:44
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:13.14.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Attachments:( 0) iax_reload.patch
Description:When reloading the config containing an IAX peer with a destination hostname (rather than IP address), the target address/and port are invalidated resulting in the peer becoming unreachable.

This is accompanied by errors like this:
ERROR[734] netsock2.c: Unknown address family '0'.
ERROR[734] netsock2.c: getnameinfo(): ai_family not supported

Looking at the code, line 12931 in chan_iax2.c appears to be the cause:
peer->addr.ss.ss_family = AST_AF_UNSPEC;

In short, the peer address is being invalidated on the assumption that the subsequent ast_dnsmgr_lookup() call will restore it.  However, if dnsmgr is enabled - then this doesn't happen, as the ast_dnsmgr_lookup() just returns without updating the ast_sockaddr structure if the hostname hasn't changed.  

I'm not sure whether this is the correct behaviour or not if dnsmgr is not enabled, but it certainly doesn't seem to be if it is.

Attached is a proposed patch to force a refresh of the dnsmgr entry (if there is one) instead.
Comments:By: Asterisk Team (asteriskteam) 2017-03-14 00:10:06.906-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2017-03-14 05:50:50.132-0500

As I mentioned on your other issue if you'd like to take this through the process it'll be included faster, otherwise it is up to someone else to do so.

By: Friendly Automation (friendly-automation) 2017-03-15 22:04:45.276-0500

Change 5204 merged by zuul:
chan_iax2: Reload of iax peer results in loss of host address/port

[https://gerrit.asterisk.org/5204|https://gerrit.asterisk.org/5204]

By: Friendly Automation (friendly-automation) 2017-03-16 05:24:46.872-0500

Change 5205 merged by Joshua Colp:
chan_iax2: Reload of iax peer results in loss of host address/port

[https://gerrit.asterisk.org/5205|https://gerrit.asterisk.org/5205]

By: Friendly Automation (friendly-automation) 2017-03-16 05:25:04.274-0500

Change 5203 merged by Joshua Colp:
chan_iax2: Reload of iax peer results in loss of host address/port

[https://gerrit.asterisk.org/5203|https://gerrit.asterisk.org/5203]