[asterisk-commits] twilson: branch 1.4 r297959 - /branches/1.4/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 9 16:00:37 CST 2010


Author: twilson
Date: Thu Dec  9 16:00:30 2010
New Revision: 297959

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=297959
Log:
Ignore spurious REGISTER requests

If a REGISTER request with a Call-ID matching an existing transaction is received
it was possible that the REGISTER request would overwrite the initreq of the
private structure. This info is used to generate messages for other responses in
the transaction. This patch ignores REGISTER requests that match non-REGISTER
transactions.

(closes issue #18051)
Reported by: eeman
Tested by: twilson

Review: https://reviewboard.asterisk.org/r/1050/

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=297959&r1=297958&r2=297959
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Thu Dec  9 16:00:30 2010
@@ -16754,6 +16754,13 @@
 static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, char *e)
 {
 	enum check_auth_result res;
+
+	/* If this is not the intial request, and the initial request isn't
+	 * a register, something screwy happened, so bail */
+	if (p->initreq.headers && p->initreq.method != SIP_REGISTER) {
+		ast_log(LOG_WARNING, "Ignoring spurious REGISTER with Call-ID: %s\n", p->callid);
+		return -1;
+	}
 
 	/* Use this as the basis */
 	if (ast_test_flag(req, SIP_PKT_DEBUG))




More information about the asterisk-commits mailing list