aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-07-26 14:37:39 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-07-26 14:39:46 +0200
commit26a42c07837d43c760f9fba98c82a5f9cff6aa51 (patch)
treefa3b68081aef1b278b90ee6bcca4205339d13d88
parentcosmetic: gb/gprs_ns.c: fix trailing whitespace (diff)
downloadlibosmocore-26a42c07837d43c760f9fba98c82a5f9cff6aa51.tar.xz
libosmocore-26a42c07837d43c760f9fba98c82a5f9cff6aa51.zip
gb/bssgp: Abort clearly if backward-compat API is used in wrong way
Some tests under osmo-pcu (TbfTest) were caught accessning NULL pointer bssgp_nsi in bssgp_tx_llc_discarded triggered by timeout while stepping slowly with the debugger. It seems that test is not properly using neither the old nor the new API. Let's catch such cases easily. Change-Id: I3ea42755c4bfd29e4a01ad57f186f28d58ab466a
-rw-r--r--src/gb/gprs_bssgp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index 14a5e9de..c967f730 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -77,6 +77,7 @@ static int _bssgp_tx_dl_ud(struct bssgp_flow_control *fc, struct msgb *msg,
/* callback to be backward compatible with old users which do not set the bssgp_ns_send function */
static int _gprs_ns_sendmsg(void *ctx, struct msgb *msg)
{
+ OSMO_ASSERT(bssgp_nsi);
return gprs_ns_sendmsg(bssgp_nsi, msg);
}