diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-06 08:34:46 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-06 08:34:46 +0800 |
commit | b84b5f61ac36b6814fdc385d2b1eb8fc32659372 (patch) | |
tree | 12bc81b1919ea13d9e877a9bb374fa088545fd7e /openbsc | |
parent | 4634013cde42402d1ab744986c4c064efc53c080 (diff) |
nat: Free the endpoint when we get an empty CI.
In case the BSC is sending us an empty/unused CI we have
a bug, but for now let us free the endpoint and figure out
which response we are getting.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/nat/bsc_mgcp_utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c index 0455d1b05..17c4bbfa5 100644 --- a/openbsc/src/nat/bsc_mgcp_utils.c +++ b/openbsc/src/nat/bsc_mgcp_utils.c @@ -314,6 +314,13 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg) } endp->ci = bsc_mgcp_extract_ci((const char *) msg->l2h); + if (endp->ci == CI_UNUSED) { + LOGP(DMGCP, LOGL_ERROR, "No CI, freeing endpoint 0x%x\n", + ENDPOINT_NUMBER(endp)); + bsc_mgcp_free_endpoint(bsc->nat, ENDPOINT_NUMBER(endp)); + mgcp_free_endp(endp); + return; + } /* free some stuff */ talloc_free(bsc_endp->transaction_id); |