From: Richard Mudgett Date: Wed, 8 Jun 2011 18:46:30 +0000 (+0000) Subject: SRV lookup attempted for SIP peers listed as an IP address. X-Git-Tag: 1.8.5-rc1~11^2~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b2172bea38300601aea4c5872fbbde7a5d814b2;p=thirdparty%2Fasterisk.git 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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322425 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/dnsmgr.c b/main/dnsmgr.c index 7fb5f88031..8e856d3516 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -131,6 +131,14 @@ int ast_dnsmgr_lookup(const char *name, struct ast_sockaddr *result, struct ast_ return 0; } + /* + * If it's actually an IP address and not a name, there's no + * need for a managed lookup. + */ + if (ast_sockaddr_parse(result, name, 0)) { + return 0; + } + ast_verb(4, "doing dnsmgr_lookup for '%s'\n", name); /* do a lookup now but add a manager so it will automagically get updated in the background */