diff --git a/src/context_map.c b/src/context_map.c index cd6cd81a..7cfc7e6a 100644 --- a/src/context_map.c +++ b/src/context_map.c @@ -76,6 +76,9 @@ context_map_alloc_by_hnb(struct hnb_context *hnb, uint32_t rua_ctx_id, return NULL; } + LOGP(DMAIN, LOGL_INFO, "Creating new Mapping RUA CTX %p/%u <-> SCU Conn ID %p/%u\n", + hnb, rua_ctx_id, cn_if_new, new_scu_conn_id); + /* alloate a new map entry */ map = talloc_zero(hnb, struct hnbgw_context_map); map->state = MAP_S_NULL; @@ -109,7 +112,7 @@ context_map_by_cn(struct hnbgw_cnlink *cn, uint32_t scu_conn_id) * direction, as the RUA=SCCP=SUA connections are always * established from HNB towards CN. */ LOGP(DMAIN, LOGL_NOTICE, "Unable to resolve map for CN " - "connection ID %u\n", scu_conn_id); + "connection ID %p/%u\n", cn, scu_conn_id); return NULL; } diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 961a5c57..98855534 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -168,6 +168,11 @@ static int rua_to_scu(struct hnb_context *hnb, struct hnbgw_cnlink *cn, struct hnbgw_context_map *map; int rc; + if (!cn) { + DEBUGP(DRUA, "CN=NULL, discarding message\n"); + return 0; + } + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); osmo_prim_init(&prim->oph, SCCP_SAP_USER, type, PRIM_OP_REQUEST, msg); diff --git a/src/ranap_common.h b/src/ranap_common.h index f3791b05..e30ca2a6 100644 --- a/src/ranap_common.h +++ b/src/ranap_common.h @@ -590,7 +590,8 @@ #include #include -#define RANAP_DEBUG(x, args ...) DEBUGP(0, x, ## args) +#include "hnbgw.h" +#define RANAP_DEBUG(x, args ...) DEBUGP(DRANAP, x, ## args) extern int asn1_xer_print; diff --git a/src/tests/ranap_common_cn.c b/src/tests/ranap_common_cn.c index 14a192f6..f8b8e6e6 100644 --- a/src/tests/ranap_common_cn.c +++ b/src/tests/ranap_common_cn.c @@ -192,6 +192,8 @@ int cn_ranap_rx_co(void *ctx, uint8_t *data, size_t len) if (rc == 0) cn_ranap_handle_co(ctx, &message); + else + LOGP(DRANAP, LOGL_ERROR, "Not calling cn_ranap_handle_co() due to rc=%d\n", rc); ASN_STRUCT_FREE(asn_DEF_RANAP_RANAP_PDU, pdu); @@ -325,6 +327,8 @@ int cn_ranap_rx_cl(void *ctx, uint8_t *data, size_t len) if (rc == 0) cn_ranap_handle_cl(ctx, &message); + else + LOGP(DRANAP, LOGL_ERROR, "Not calling cn_ranap_handle_cl() due to rc=%d\n", rc); ASN_STRUCT_FREE(asn_DEF_RANAP_RANAP_PDU, pdu);