[asterisk-commits] simon.perreault: branch group/v6-new r274684 - /team/group/v6-new/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 7 14:48:45 CDT 2010


Author: simon.perreault
Date: Wed Jul  7 14:48:41 2010
New Revision: 274684

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=274684
Log:
Handle null addresses in RTP instance getters

Modified:
    team/group/v6-new/main/rtp_engine.c

Modified: team/group/v6-new/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/main/rtp_engine.c?view=diff&rev=274684&r1=274683&r2=274684
==============================================================================
--- team/group/v6-new/main/rtp_engine.c (original)
+++ team/group/v6-new/main/rtp_engine.c Wed Jul  7 14:48:41 2010
@@ -409,7 +409,8 @@
 int ast_rtp_instance_get_local_address(struct ast_rtp_instance *instance,
 		struct ast_sockaddr *address)
 {
-	if (ast_sockaddr_cmp(address, &instance->local_address) != 0) {
+	if (ast_sockaddr_isnull(&instance->local_address) ||
+	    ast_sockaddr_cmp(address, &instance->local_address) != 0) {
 		ast_sockaddr_copy(address, &instance->local_address);
 		return 1;
 	}
@@ -420,7 +421,8 @@
 int ast_rtp_instance_get_remote_address(struct ast_rtp_instance *instance,
 		struct ast_sockaddr *address)
 {
-	if (ast_sockaddr_cmp(address, &instance->remote_address) != 0) {
+	if (!ast_sockaddr_isnull(&instance->remote_address) &&
+	    ast_sockaddr_cmp(address, &instance->remote_address) != 0) {
 		ast_sockaddr_copy(address, &instance->remote_address);
 		return 1;
 	}




More information about the asterisk-commits mailing list