aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-23 18:38:42 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-23 18:38:42 +0000
commit9e2cc5b5bb3441da264edf843d50f34c71d34bba (patch)
tree00654732a9c30b40ca2340bdeee596b710679eac
parentd89fe69ec7cba6bb417183e09a789575a3da7949 (diff)
reformat a statement and comment a potentially wrong
assignement (altering state on an unvalidated message). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46015 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8d48c74fd..85f3b9ac9 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9023,15 +9023,10 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
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 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
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;