[asterisk-commits] simon.perreault: branch group/v6-new r272525 - in /team/group/v6-new: channel...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 25 10:47:02 CDT 2010
Author: simon.perreault
Date: Fri Jun 25 10:46:58 2010
New Revision: 272525
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=272525
Log:
Fixed handling of port number in SRV lookups.
Modified:
team/group/v6-new/channels/chan_sip.c
team/group/v6-new/main/acl.c
Modified: team/group/v6-new/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/channels/chan_sip.c?view=diff&rev=272525&r1=272524&r2=272525
==============================================================================
--- team/group/v6-new/channels/chan_sip.c (original)
+++ team/group/v6-new/channels/chan_sip.c Fri Jun 25 10:46:58 2010
@@ -4951,16 +4951,17 @@
*/
if (!ast_sockaddr_port(&dialog->sa) && sip_cfg.srvlookup) {
snprintf(service, sizeof(service), "_sip._%s.%s", get_transport(dialog->socket.type), peername);
- srv_ret = ast_get_srv(NULL, host, sizeof(host), &tportno, service);
- if (srv_ret > 0) {
+ if ((srv_ret = ast_get_srv(NULL, host, sizeof(host), &tportno,
+ service)) > 0)
hostn = host;
- ast_sockaddr_set_port(&dialog->sa, tportno);
- }
}
if (ast_sockaddr_resolve_first(&dialog->sa, hostn,
PARSE_PORT_FORBID, 0))
ast_log(LOG_WARNING, "No such host: %s\n", peername);
+
+ if (srv_ret > 0)
+ ast_sockaddr_set_port(&dialog->sa, tportno);
}
if (!dialog->socket.type)
Modified: team/group/v6-new/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/main/acl.c?view=diff&rev=272525&r1=272524&r2=272525
==============================================================================
--- team/group/v6-new/main/acl.c (original)
+++ team/group/v6-new/main/acl.c Fri Jun 25 10:46:58 2010
@@ -382,14 +382,13 @@
char host[256];
struct ast_sockaddr *addrs;
int addrs_cnt;
+ int srv_ret = 0;
int tportno;
if (service) {
snprintf(srv, sizeof(srv), "%s.%s", service, value);
- if (ast_get_srv(NULL, host, sizeof(host), &tportno, srv) > 0) {
+ if ((srv_ret = ast_get_srv(NULL, host, sizeof(host), &tportno, srv)) > 0)
value = host;
- ast_sockaddr_set_port(addr, tportno);
- }
}
addrs_cnt = ast_sockaddr_resolve(&addrs, value, PARSE_PORT_FORBID, addr->ss.ss_family);
@@ -402,6 +401,9 @@
ast_log(LOG_WARNING, "Unable to lookup '%s'\n", value);
return -1;
}
+
+ if (srv_ret > 0)
+ ast_sockaddr_set_port(addr, tportno);
return 0;
}
More information about the asterisk-commits
mailing list