[Home]

Summary:ASTERISK-17815: [patch] [regression] SRV lookup attempted for peers listed by IP address
Reporter:Byron Clark (byronclark)Labels:
Date Opened:2011-05-05 15:44:36Date Closed:2011-06-08 14:05:43
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) issue19248_v1.8.patch
( 1) skip_srv_lookup_for_ip_address_v2.patch
( 2) skip_srv_lookup_for_ip_address.patch
Description:Our configuration lists a lot of peers by IP address, like this:

[pbx](!)
type=peer
nat=yes
qualify=no
insecure=port,invite
deny=0.0.0.0/0.0.0.0
permit=10.199.7.0/255.255.255.0
call-limit=0

[10.199.7.1](pbx)
host=10.199.7.1

[10.199.7.2](pbx)
host=10.199.7.2


Upon upgrading from 1.6.2.17.3 to 1.8.3.3, asterisk took significantly longer (minutes) to start. The startup delay comes because asterisk attempts to do an SRV lookup for each of those peers which then times out.

The attached patch (against svn trunk) brings back a shortcut from 1.6.2.17.3 that skipped the SRV lookup if inet_aton succeeded on the host.  Admittedly, the check should also handle an IPv6 address.
Comments:By: Byron Clark (byronclark) 2011-05-05 15:46:54

The v2 patch allows peers that are not listed as an IP address to work correctly.

By: Leif Madsen (lmadsen) 2011-05-09 09:22:06

Thanks for the patches!

By: Richard Mudgett (rmudgett) 2011-05-31 17:26:49

The issue19248_v1.8.patch should handle IPv4 and IPv6 addresses.

By: Richard Mudgett (rmudgett) 2011-06-07 19:53:33.793-0500

The [^issue19248_v1.8.patch] should handle IPv4 and IPv6 addresses.

By: Byron Clark (byronclark) 2011-06-08 10:39:32.943-0500

[^issue19248_v1.8.patch] fixes the issue for me.

By: Richard Mudgett (rmudgett) 2011-06-08 14:05:43.697-0500

Committed
-r322425 v1.8
-r322426 trunk

SRV lookup attempted for SIP peers listed as an IP address.

Asterisk attempts to SRV lookup a host name even if the host name is an IP
address.  Regression introduced when IPv6 support was added.

* Restored the check in ast_dnsmgr_lookup() to see if the given host name
is an IP address.  The IP address could be in either IPv4 or IPv6 formats.

(closes issue ASTERISK-17815)
Reported by: Byron Clark
Tested by: Byron Clark, Richard Mudgett
Patches:
    issue19248_v1.8.patch - uploaded by Richard Mudgett (License #5621)

Review: https://reviewboard.asterisk.org/r/1240/