Abort if processing SCTP connection without HNB context

It was observed that under some circumstances (after HNBAP
HNB-De-Register) we end up crashing because a connection has no HNB
assigned to it. Let's explicitly assert if that happens, in order
clarify and avoid same sort of thing happening without clear view on
what's going on.
The issue will be fixed in a follow-up patch.

Closes: OS#5676
Change-Id: I1eedab6f3ac974e942b02eaae41556f87dd8b6ba
This commit is contained in:
Harald Welte 2022-09-12 08:57:58 +02:00 committed by Pau Espin Pedrol
parent eadf523393
commit c971c657c5
1 changed files with 1 additions and 0 deletions

View File

@ -245,6 +245,7 @@ static int hnb_read_cb(struct osmo_stream_srv *conn)
if (!msg)
return -ENOMEM;
OSMO_ASSERT(hnb);
/* we store a reference to the HomeNodeB in the msg->dest for the
* benefit of various downstream processing functions */
msg->dst = hnb;