[svn-commits] elguero: branch 12 r401183 - in /branches/12: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Oct 18 10:13:04 CDT 2013


Author: elguero
Date: Fri Oct 18 10:13:02 2013
New Revision: 401183

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401183
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/
........

Merged revisions 401182 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/channels/chan_sip.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_sip.c?view=diff&rev=401183&r1=401182&r2=401183
==============================================================================
--- branches/12/channels/chan_sip.c (original)
+++ branches/12/channels/chan_sip.c Fri Oct 18 10:13:02 2013
@@ -18379,9 +18379,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 svn-commits mailing list