[svn-commits] pabelanger: trunk r293497 - in /trunk: ./ channels/chan_iax2.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 1 11:11:55 CDT 2010


Author: pabelanger
Date: Mon Nov  1 11:11:50 2010
New Revision: 293497

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=293497
Log:
Merged revisions 293496 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r293496 | pabelanger | 2010-11-01 12:09:05 -0400 (Mon, 01 Nov 2010) | 13 lines
  
  Use ast_sockaddr_from_sin function not memcpy
  
  This resolves some IAX2 registration issue report on the 
  asterisk-users mailing list. 
  
  (closes issue #18202)
  Reported by: pabelanger
  Patches: 
        update_registry.patch.v2 uploaded by pabelanger (license 224)
  Tested by: pabelanger, Nic Colledge (mailing list)
  
  Review: https://reviewboard.asterisk.org/r/993
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_iax2.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=293497&r1=293496&r2=293497
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Mon Nov  1 11:11:50 2010
@@ -8700,7 +8700,7 @@
 		peercnt_modify(0, 0, &p->addr);
 
 		/* Stash the IP address from which they registered */
-		memcpy(&p->addr, sin, sizeof(p->addr));
+		ast_sockaddr_from_sin(&p->addr, sin);
 
 		snprintf(data, sizeof(data), "%s:%d:%d", ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port), p->expiry);
 		if (!ast_test_flag64(p, IAX_TEMPONLY) && sin->sin_addr.s_addr) {
@@ -11190,10 +11190,13 @@
 				if ((ast_strlen_zero(iaxs[fr->callno]->secret) && ast_strlen_zero(iaxs[fr->callno]->inkeys)) ||
 						ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_AUTHENTICATED)) {
 
-					if (f.subclass.integer == IAX_COMMAND_REGREL)
+					if (f.subclass.integer == IAX_COMMAND_REGREL) {
 						memset(&sin, 0, sizeof(sin));
-					if (update_registry(&sin, fr->callno, ies.devicetype, fd, ies.refresh))
+						sin.sin_family = AF_INET;
+					}
+					if (update_registry(&sin, fr->callno, ies.devicetype, fd, ies.refresh)) {
 						ast_log(LOG_WARNING, "Registry error\n");
+					}
 					if (!iaxs[fr->callno]) {
 						break;
 					}




More information about the svn-commits mailing list