Change in libosmocore[master]: gb/bssgp: Abort clearly if backward-compat API is used in wrong way

pespin gerrit-no-reply at lists.osmocom.org
Mon Jul 26 22:00:50 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/25043 )

Change subject: gb/bssgp: Abort clearly if backward-compat API is used in wrong way
......................................................................

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
---
M src/gb/gprs_bssgp.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  daniel: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index 14a5e9d..c967f73 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -77,6 +77,7 @@
 /* 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);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/25043
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3ea42755c4bfd29e4a01ad57f186f28d58ab466a
Gerrit-Change-Number: 25043
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210726/1950dd42/attachment.htm>


More information about the gerrit-log mailing list