neels has uploaded this change for review.

View Change

fix hnbgw: RAN_Emu: ranap_unitdata_cb: call only when present

osmo-hnbgw since recently sends own RANAP RESET out to the CN links. So
HNBGW_Tests.ttcn now receives a lot more UnitData messages.

Turns out that tests crash when no UnitData callback is provided.

Currently only osmo-hnbgw and RANAP, i.e. ranap_unitdata_cb, needs this
fix, but also apply the same safeguard to the BSSAP unitdata_cb.

Change-Id: I699a42de88b15f6f47b8feece7639e0dfaf31955
---
M library/RAN_Emulation.ttcnpp
1 file changed, 23 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/06/33406/1
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index 543df2b..6a1f784 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -515,6 +515,9 @@
log("CommonBssmapUnitdataCallback: Not a paging message");
}
/* ELSE: handle in user callback */
+ if (not ispresent(g_ran_ops.unitdata_cb)) {
+ return omit;
+ }
return g_ran_ops.unitdata_cb.apply(bssap);
}

@@ -675,6 +678,9 @@
}

/* ELSE: handle in user callback */
+ if (not ispresent(g_ran_ops.ranap_unitdata_cb)) {
+ return omit;
+ }
return g_ran_ops.ranap_unitdata_cb.apply(ranap);
}


To view, visit change 33406. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I699a42de88b15f6f47b8feece7639e0dfaf31955
Gerrit-Change-Number: 33406
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange