From 26a42c07837d43c760f9fba98c82a5f9cff6aa51 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 26 Jul 2021 14:37:39 +0200 Subject: 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 --- src/gb/gprs_bssgp.c | 1 + 1 file changed, 1 insertion(+) 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); } -- cgit v1.2.3