[asterisk-commits] russell: branch group/security_events r201146 - /team/group/security_events/c...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 16 16:12:38 CDT 2009


Author: russell
Date: Tue Jun 16 16:12:34 2009
New Revision: 201146

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201146
Log:
Simplify some code, getsockname() isn't needed

Modified:
    team/group/security_events/channels/chan_sip.c

Modified: team/group/security_events/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/channels/chan_sip.c?view=diff&rev=201146&r1=201145&r2=201146
==============================================================================
--- team/group/security_events/channels/chan_sip.c (original)
+++ team/group/security_events/channels/chan_sip.c Tue Jun 16 16:12:34 2009
@@ -11965,8 +11965,6 @@
 static struct sockaddr_in *encode_sin_local(struct sockaddr_in *sin_local,
 		const struct sip_pvt *pvt)
 {
-	socklen_t sin_local_len;
-
 	if (pvt->socket.type == SIP_TRANSPORT_UDP) {
 		memcpy(sin_local, &bindaddr, sizeof(*sin_local));
 		return sin_local;
@@ -11977,10 +11975,7 @@
 		return sin_local;
 	}
 
-	sin_local_len = sizeof(*sin_local);
-	if (getsockname(pvt->socket.tcptls_session->fd, sin_local, &sin_local_len)) {
-		ast_log(LOG_WARNING, "getsockname() failed: %s\n", strerror(errno));
-	}
+	*sin_local = pvt->socket.tcptls_session->parent->local_address;
 
 	return sin_local;
 }




More information about the asterisk-commits mailing list