diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-09 22:00:30 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-09 22:00:30 +0000 |
commit | e80188a0965bfdfcaa5598225a0835cd81be40c6 (patch) | |
tree | c8a127475b4d3abf1872f543cbf8de433efc1488 /channels | |
parent | 329ee1b112ba71f6c204b8dab7b7bb0cda3f8c95 (diff) |
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/
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@297959 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index bdc375ce4..3caf1c66d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -16755,6 +16755,13 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, s { 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)) ast_verbose("Using latest REGISTER request as basis request\n"); |