osmo-epdg: gsup: check if the current_request exist

The current_request can be NULL if the osmo-epdg took too long to respond
and the requester free'd the request
This commit is contained in:
Alexander Couzens 2024-02-17 02:03:45 +01:00
parent 48bb62a4ee
commit 15ab60873e
1 changed files with 6 additions and 0 deletions

View File

@ -491,6 +491,12 @@ static bool on_recv_pdu(void *data, osmo_epdg_ipa_client_t *client, struct msgb
case OSMO_GSUP_MSGT_EPDG_TUNNEL_ERROR:
case OSMO_GSUP_MSGT_EPDG_TUNNEL_RESULT:
this->mutex->lock(this->mutex);
if (!this->current_request)
{
/* a timeout happened and current_request is NULL */
this->mutex->unlock(this->mutex);
goto out;
}
if ((this->current_request->msg_type & 0xfffffffc) != (resp->gsup.message_type & 0xfffffffc))
{
/* Request, Result, Error, Other are encoded in the last 2 bits */