aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-24 23:57:58 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2017-12-25 00:46:12 +0100
commit1e9f4f5432fff3ff96d23b16252dd865b9e7aa62 (patch)
tree82f41f7a981db02759f268e9eb38a8c313cf223b /src
parentb10e2937d94d30a9c33bb70ea291c856868490be (diff)
rua_to_scu(): don't create a context map for UNITDATA
UNITDATA is connection-less, and as can be observed further below, the 'map' doesn't get used in the N_UNIDATA case. Related: OS#2776 Change-Id: Ic35562e6d7bfa54b6be859860657f9a235ad5a50
Diffstat (limited to 'src')
-rw-r--r--src/hnbgw_rua.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 1d0ffbd..58bb23b 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -213,13 +213,21 @@ static int rua_to_scu(struct hnb_context *hnb,
prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim));
osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg);
- map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);
- OSMO_ASSERT(map);
-
- DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n",
- cn_domain_indicator_to_str(cN_DomainIndicator),
- osmo_sccp_addr_dump(remote_addr),
- map->rua_ctx_id, map->scu_conn_id);
+ switch (type) {
+ case OSMO_SCU_PRIM_N_UNITDATA:
+ DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, no scu_conn_id)\n",
+ cn_domain_indicator_to_str(cN_DomainIndicator),
+ osmo_sccp_addr_dump(remote_addr),
+ map->rua_ctx_id);
+ break;
+ default:
+ map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);
+ OSMO_ASSERT(map);
+ DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n",
+ cn_domain_indicator_to_str(cN_DomainIndicator),
+ osmo_sccp_addr_dump(remote_addr),
+ map->rua_ctx_id, map->scu_conn_id);
+ }
/* add primitive header */
switch (type) {
@@ -263,7 +271,7 @@ static int rua_to_scu(struct hnb_context *hnb,
rc = osmo_sccp_user_sap_down(cn->sccp_user, &prim->oph);
- if (release_context_map)
+ if (map && release_context_map)
context_map_deactivate(map);
return rc;