[PATCH] 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 Aug 22 21:45:49 UTC 2016


Review at  https://gerrit.osmocom.org/744

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: I27ea7c4631b87f1d6ef57895306209bf3ccdc739
---
M src/common/rsl.c
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/744/1

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 490ae28..622fdae 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;
 }
 
@@ -2080,7 +2082,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));
@@ -2224,7 +2226,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));
@@ -2278,7 +2280,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));
@@ -2377,7 +2379,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/744
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27ea7c4631b87f1d6ef57895306209bf3ccdc739
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list