bsc: dtap: Set subscr log context
Change-Id: I362a7d10f5ca9a95b594f7caafd7ed5b10fd059a
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index c3c5000..2c6a689 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -602,8 +602,10 @@
{
int lu_cause;
+ log_set_context(LOG_CTX_BSC_SUBSCR, conn->bsub);
+
if (!msc_connected(conn))
- return;
+ goto done;
LOGP(DMSC, LOGL_INFO, "Tx MSC DTAP LINK_ID=0x%02x\n", link_id);
@@ -612,7 +614,7 @@
* to handle it. If it was handled we will return.
*/
if (handle_cc_setup(conn, msg) >= 1)
- return;
+ goto done;
/* Check the filter */
if (bsc_filter_data(conn, msg, &lu_cause) < 0) {
@@ -620,7 +622,7 @@
conn->filter_state.con_type,
lu_cause);
bsc_clear_request(conn, 0);
- return;
+ goto done;
}
bsc_scan_bts_msg(conn, msg);
@@ -628,6 +630,9 @@
/* Store link_id in msg->cb */
OBSC_LINKID_CB(msg) = link_id;
osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_MO_DTAP, msg);
+done:
+ log_set_context(LOG_CTX_BSC_SUBSCR, NULL);
+ return;
}
/*! BSC->MSC: RR conn has been cleared. */
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 39425f6..b5ff152 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -980,6 +980,8 @@
int bsc_handle_dt(struct gsm_subscriber_connection *conn,
struct msgb *msg, unsigned int len)
{
+ log_set_context(LOG_CTX_BSC_SUBSCR, conn->bsub);
+
if (len < sizeof(struct bssmap_header)) {
LOGP(DMSC, LOGL_ERROR, "The header is too short.\n");
}
@@ -997,6 +999,7 @@
gsm0808_bssap_name(msg->l3h[0]));
}
+ log_set_context(LOG_CTX_BSC_SUBSCR, NULL);
return -1;
}