[MERGED] osmo-bts[master]: log causing rx event for lchan_lookup errors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Sep 19 02:12:23 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: log causing rx event for lchan_lookup errors
......................................................................


log causing rx event for lchan_lookup errors

Add log_name to lchan_lookup() and pass such from the various RSL rx events
that call it to validate the RSL chan_nr.

Change-Id: I0d9923f47ac655b204169eec302d607412d5754d
---
M src/common/rsl.c
1 file changed, 10 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/rsl.c b/src/common/rsl.c
index 559599f..493ff3b 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -144,19 +144,21 @@
 	return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT);
 }
 
-static struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr)
+static struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
+				      const char *log_name)
 {
 	int rc;
 	struct gsm_lchan *lchan = rsl_lchan_lookup(trx, chan_nr, &rc);
 
 	if (!lchan) {
-		LOGP(DRSL, LOGL_ERROR, "unknown chan_nr=0x%02x\n", chan_nr);
+		LOGP(DRSL, LOGL_ERROR, "%sunknown chan_nr=0x%02x\n", log_name,
+		     chan_nr);
 		return NULL;
 	}
 
 	if (rc < 0)
-		LOGP(DRSL, LOGL_ERROR, "%s mismatching chan_nr=0x%02x\n",
-		     gsm_ts_and_pchan_name(lchan->ts), chan_nr);
+		LOGP(DRSL, LOGL_ERROR, "%s %smismatching chan_nr=0x%02x\n",
+		     gsm_ts_and_pchan_name(lchan->ts), log_name, chan_nr);
 	return lchan;
 }
 
@@ -2105,7 +2107,7 @@
 	}
 	msg->l3h = (unsigned char *)rh + sizeof(*rh);
 
-	lchan = lchan_lookup(trx, rh->chan_nr);
+	lchan = lchan_lookup(trx, rh->chan_nr, "RSL rx RLL: ");
 	if (!lchan) {
 		LOGP(DRLL, LOGL_NOTICE, "Rx RLL %s for unknown lchan\n",
 			rsl_msg_name(rh->c.msg_type));
@@ -2249,7 +2251,7 @@
 	}
 	msg->l3h = (unsigned char *)cch + sizeof(*cch);
 
-	msg->lchan = lchan_lookup(trx, cch->chan_nr);
+	msg->lchan = lchan_lookup(trx, cch->chan_nr, "RSL rx CCHAN: ");
 	if (!msg->lchan) {
 		LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknown lchan\n",
 			rsl_msg_name(cch->c.msg_type));
@@ -2303,7 +2305,7 @@
 	}
 	msg->l3h = (unsigned char *)dch + sizeof(*dch);
 
-	msg->lchan = lchan_lookup(trx, dch->chan_nr);
+	msg->lchan = lchan_lookup(trx, dch->chan_nr, "RSL rx DCHAN: ");
 	if (!msg->lchan) {
 		LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknown lchan\n",
 			rsl_or_ipac_msg_name(dch->c.msg_type));
@@ -2402,7 +2404,7 @@
 	}
 	msg->l3h = (unsigned char *)dch + sizeof(*dch);
 
-	msg->lchan = lchan_lookup(trx, dch->chan_nr);
+	msg->lchan = lchan_lookup(trx, dch->chan_nr, "RSL rx IPACC: ");
 	if (!msg->lchan) {
 		LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknow lchan\n",
 			rsl_msg_name(dch->c.msg_type));

-- 
To view, visit https://gerrit.osmocom.org/746
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d9923f47ac655b204169eec302d607412d5754d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list