From 57f32626e33ab710788192dd2254d59eb872d4a9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 4 May 2018 22:55:33 +0200 Subject: log: fix logging in rsl_rx_chan_act_nack() In each code path within rsl_rx_chan_act_nack(), do separate logging of the NACK to ensure proper termination of each log line. When receiving a Chan Act NACK, we possibly mixed a LOGP() within an unterminated other LOGP() that had not been ended with a LOGPC() yet. Change-Id: Icd2772b21ef3a2ff5af11b7c92dff0ecb4d87ff0 --- src/osmo-bsc/abis_rsl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/osmo-bsc/abis_rsl.c') diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 7bbde47d7..60b836d31 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1328,18 +1328,21 @@ static int rsl_rx_chan_act_nack(struct msgb *msg) return -1; } - LOGP(DRSL, LOGL_ERROR, "%s CHANNEL ACTIVATE NACK ", - gsm_lchan_name(msg->lchan)); - /* BTS has rejected channel activation ?!? */ - if (dh->ie_chan != RSL_IE_CHAN_NR) + if (dh->ie_chan != RSL_IE_CHAN_NR) { + LOGP(DRSL, LOGL_ERROR, "%s CHANNEL ACTIVATE NACK, and chan nr mismatches\n", + gsm_lchan_name(msg->lchan)); return -EINVAL; + } rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh)); if (TLVP_PRESENT(&tp, RSL_IE_CAUSE)) { const uint8_t *cause = TLVP_VAL(&tp, RSL_IE_CAUSE); + LOGP(DRSL, LOGL_ERROR, "%s CHANNEL ACTIVATE NACK: ", + gsm_lchan_name(msg->lchan)); print_rsl_cause(LOGL_ERROR, cause, TLVP_LEN(&tp, RSL_IE_CAUSE)); + LOGPC(DRSL, LOGL_ERROR, "\n"); msg->lchan->error_cause = *cause; if (*cause != RSL_ERR_RCH_ALR_ACTV_ALLOC) { rsl_lchan_mark_broken(msg->lchan, "NACK on activation"); @@ -1347,11 +1350,11 @@ static int rsl_rx_chan_act_nack(struct msgb *msg) rsl_rf_chan_release(msg->lchan, 1, SACCH_DEACTIVATE); } else { + LOGP(DRSL, LOGL_ERROR, "%s CHANNEL ACTIVATE NACK, no cause IE\n", + gsm_lchan_name(msg->lchan)); rsl_lchan_mark_broken(msg->lchan, "NACK on activation no IE"); } - LOGPC(DRSL, LOGL_ERROR, "\n"); - send_lchan_signal(S_LCHAN_ACTIVATE_NACK, msg->lchan, NULL); return 0; } -- cgit v1.2.3