From 75d4f7e1c2bf6b31e91ecf0df5bca924d4a10ce5 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 29 Dec 2008 14:52:22 +0000 Subject: [PATCH] Per kpfleming add a note describing why you must never change the first element of peer_finding_info. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@166858 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a960f9612c..4155bf8e10 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4087,6 +4087,11 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct sockaddr_i return peer; } +/* The first element here must *always* be tmp_peer. This is because the user of this function + * passes it in using OBJ_POINTER which causes astobj2 to perform hashing on the name to find + * where the peer is. Since tmp_peer is at the beginning this just magically works. Move it and it + * will break. People will be angry. Just don't do it. + */ struct peer_finding_info { struct sip_peer tmp_peer; int forcenamematch;