[asterisk-commits] rizzo: trunk r46015 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 23 11:38:43 MST 2006


Author: rizzo
Date: Mon Oct 23 13:38:42 2006
New Revision: 46015

URL: http://svn.digium.com/view/asterisk?rev=46015&view=rev
Log:
reformat a statement and comment a potentially wrong
assignement (altering state on an unvalidated message).


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=46015&r1=46014&r2=46015&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Oct 23 13:38:42 2006
@@ -9023,15 +9023,10 @@
 	int debug=sip_debug_test_addr(sin);
 	struct sip_peer *peer;
 
-	if (sipmethod == SIP_SUBSCRIBE)
-		/* For subscribes, match on peer name only */
-		peer = find_peer(of, NULL, 1);
-	else
-		/* Look for peer based on the IP address we received data from */
-		/* If peer is registered from this IP address or have this as a default
-		   IP address, this call is from the peer 
-		*/
-		peer = find_peer(NULL, &p->recv, 1);
+	/* For subscribes, match on peer name only; for other methods,
+	 * match on IP address-port of the incoming request.
+	 */
+	peer = (sipmethod == SIP_SUBSCRIBE) ? find_peer(of, NULL, 1) : find_peer(NULL, &p->recv, 1);
 
 	if (!peer) {
 		if (debug)
@@ -9056,6 +9051,7 @@
 	ast_copy_flags(&p->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
 
 	/* Copy SIP extensions profile to peer */
+	/* XXX is this correct before a successful auth ? */
 	if (p->sipoptions)
 		peer->sipoptions = p->sipoptions;
 



More information about the asterisk-commits mailing list