laforge has uploaded this change for review.

View Change

mgw_fsm: Add some OSMO_ASSERT() to ensure only CS maps passed

The mgw_fsm only supports CS RABs in the CS domain; let's add some
ASSERTs to make sure the impossible doesn't happen.

Change-Id: I264c4b3da17b6f59ebcdd02031318402a483041a
---
M src/osmo-hnbgw/mgw_fsm.c
1 file changed, 19 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/50/36250/1
diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c
index 6d23790..d0dc6df 100644
--- a/src/osmo-hnbgw/mgw_fsm.c
+++ b/src/osmo-hnbgw/mgw_fsm.c
@@ -807,6 +807,8 @@
struct mgw_fsm_priv *mgw_fsm_priv;
char fsm_name[255];

+ OSMO_ASSERT(!map->is_ps);
+
/* Initialize FSM if not done yet */
if (!initialized) {
OSMO_ASSERT(osmo_fsm_register(&mgw_fsm) == 0);
@@ -878,6 +880,7 @@
struct mgw_fsm_priv *mgw_fsm_priv;

OSMO_ASSERT(ranap_msg);
+ OSMO_ASSERT(!map->is_ps);

if (!map->mgw_fi) {
/* NOTE: This situation is a corner-case. We may end up here when the co-located MGW caused a problem
@@ -916,6 +919,8 @@
* \returns 0 on success; negative on error. */
int mgw_fsm_release(struct hnbgw_context_map *map)
{
+ OSMO_ASSERT(!map->is_ps);
+
if (!map->mgw_fi)
return -EINVAL;

@@ -930,6 +935,8 @@
struct timespec elapsed;
uint64_t elapsed_ms;

+ OSMO_ASSERT(!map->is_ps);
+
if (!map->mgw_fi)
return 0;


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

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I264c4b3da17b6f59ebcdd02031318402a483041a
Gerrit-Change-Number: 36250
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-MessageType: newchange