diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-11-28 02:16:34 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2019-11-28 02:45:40 +0100 |
commit | cc918cb416e129fd6e3f3deec7e03c3f54a83535 (patch) | |
tree | d3e94d79362ba8c4ebbf90740e41d0def69afcfb /src/libmsc | |
parent | 3f07daceef8121d4d33aef8d831bf1df1966ed08 (diff) |
fail on invalid RTP address from MGW
When the CRCX OK returns an invalid RTP address, abort the call; fixes
MSC_Tests.TC_invalid_mgcp_crash.
The original crash happened when adding this error handling without this commit
I08c03946605aa12e0a5ce8b3c773704ef5327a7a ("fsm: use deferred deallocation" for
osmo-mgw I7df2e9202b04e7ca7366bb0a8ec53cf3bb14faf3 "fix use-after-free: require
new fsm deferred dealloc, check for term"). With this error handling added,
even though avoiding a crash, the test does not pass yet, because instead of
rejecting the call, it currently composes an Assignment Command without a
Transport Layer Address. Fix that.
Change-Id: I00c3b5ff74c05bcc2b7c39375c33419916a57193
Diffstat (limited to 'src/libmsc')
-rw-r--r-- | src/libmsc/msc_a.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c index 0b07fbc98..a4048f452 100644 --- a/src/libmsc/msc_a.c +++ b/src/libmsc/msc_a.c @@ -627,6 +627,12 @@ static void msc_a_fsm_communicating(struct osmo_fsm_inst *fi, uint32_t event, vo LOG_MSC_A(msc_a, LOGL_ERROR, "Invalid data for %s\n", osmo_fsm_event_name(fi->fsm, event)); return; } + if (!osmo_sockaddr_str_is_nonzero(&rtps->local)) { + LOG_MSC_A(msc_a, LOGL_ERROR, "Invalid RTP address received from MGW: " OSMO_SOCKADDR_STR_FMT "\n", + OSMO_SOCKADDR_STR_FMT_ARGS(&rtps->local)); + call_leg_release(msc_a->cc.call_leg); + return; + } LOG_MSC_A(msc_a, LOGL_DEBUG, "MGW endpoint's RTP address available for the CI %s: " OSMO_SOCKADDR_STR_FMT " (osmux=%s:%d)\n", rtp_direction_name(rtps->dir), OSMO_SOCKADDR_STR_FMT_ARGS(&rtps->local), |