[asterisk-commits] elguero: branch 11 r401182 - /branches/11/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 18 10:11:49 CDT 2013
Author: elguero
Date: Fri Oct 18 10:11:46 2013
New Revision: 401182
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401182
Log:
Remove Port Restriction When Checking For NAT
When trying to determine if a peer is behind NAT, we should not be using the
ports when comparing addresses.
This patch removes the port from being checked and just useds the addresses
now.
(closes issue ASTERISK-22729)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
asterisk-remove-using-port-for-nat-check.diff
uploaded by Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/2927/
Modified:
branches/11/channels/chan_sip.c
Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=401182&r1=401181&r2=401182
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Fri Oct 18 10:11:46 2013
@@ -17943,9 +17943,9 @@
return;
}
- if (ast_sockaddr_cmp(addr, &p->recv)) {
- char *tmp_str = ast_strdupa(ast_sockaddr_stringify(addr));
- ast_debug(3, "NAT detected for %s / %s\n", tmp_str, ast_sockaddr_stringify(&p->recv));
+ if (ast_sockaddr_cmp_addr(addr, &p->recv)) {
+ char *tmp_str = ast_strdupa(ast_sockaddr_stringify_addr(addr));
+ ast_debug(3, "NAT detected for %s / %s\n", tmp_str, ast_sockaddr_stringify_addr(&p->recv));
p->natdetected = 1;
if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
ast_set_flag(&p->flags[0], SIP_NAT_FORCE_RPORT);
More information about the asterisk-commits
mailing list