[svn-commits] elguero: trunk r371296 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 15 15:43:40 CDT 2012


Author: elguero
Date: Wed Aug 15 15:43:37 2012
New Revision: 371296

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371296
Log:
Fix Segfault When Registering SIP Over WebSockets

The helper function, get_address_family_filter, in chan_sip for dns resolution
by address family was not recognizing the websockets transport and resulting in
a null pointer being sent to functions in netsock2, in an attempt to determine
if we are bound to ANY address ([::]) or not.

This patch fixes this issue by handling the transport types SIP_TRANSPORT_WS and
SIP_TRANSPORT_WSS which results in a sock address being set properly for use in
determining the address family.

(closes issue ASTERISK-20221)
Reported by: Sven Beisiegel
Tested by: Sven Beisiegel, James Mortensen
Patches: 
asterisk-20221-ws-family-filter.diff uploaded by Michael L. Young (license 5026)
........

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

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

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Wed Aug 15 15:43:37 2012
@@ -1,1 +1,1 @@
-/branches/11:1-371121,371143,371146,371200,371227,371258,371272
+/branches/11:1-371121,371143,371146,371200,371227,371258,371272,371295

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=371296&r1=371295&r2=371296
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Aug 15 15:43:37 2012
@@ -27596,11 +27596,9 @@
 
 	if ((transport == SIP_TRANSPORT_UDP) || !transport) {
 		addr = &bindaddr;
-	}
-	else if (transport == SIP_TRANSPORT_TCP) {
+	} else if (transport == SIP_TRANSPORT_TCP || transport == SIP_TRANSPORT_WS) {
 		addr = &sip_tcp_desc.local_address;
-	}
-	else if (transport == SIP_TRANSPORT_TLS) {
+	} else if (transport == SIP_TRANSPORT_TLS || transport == SIP_TRANSPORT_WSS) {
 		addr = &sip_tls_desc.local_address;
 	}
 




More information about the svn-commits mailing list