[PATCH] openbsc[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 23:24:40 UTC 2016


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

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: Id81e7b8b9c27831923f050a78dfc7d650e687033
---
M openbsc/src/libbsc/abis_rsl.c
1 file changed, 14 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/750/1

diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 096ea29..b4eb350 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -110,19 +110,21 @@
 }
 
 /* call rsl_lchan_lookup and set the log context */
-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);
 
 	log_set_context(BSC_CTX_LCHAN, lchan);
 	if (lchan->conn)
@@ -1430,7 +1432,8 @@
 	char *ts_name;
 	struct e1inp_sign_link *sign_link = msg->dst;
 
-	msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr);
+	msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
+				  "Abis RSL rx DCHAN: ");
 	ts_name = gsm_lchan_name(msg->lchan);
 
 	switch (rslh->c.msg_type) {
@@ -1791,7 +1794,8 @@
 	struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg);
 	int rc = 0;
 
-	msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr);
+	msg->lchan = lchan_lookup(sign_link->trx, rslh->chan_nr,
+				  "Abis RSL rx CCHAN: ");
 
 	switch (rslh->c.msg_type) {
 	case RSL_MT_CHAN_RQD:
@@ -1892,7 +1896,8 @@
 	char *ts_name;
 	uint8_t sapi = rllh->link_id & 7;
 
-	msg->lchan = lchan_lookup(sign_link->trx, rllh->chan_nr);
+	msg->lchan = lchan_lookup(sign_link->trx, rllh->chan_nr,
+				  "Abis RSL rx RLL: ");
 	ts_name = gsm_lchan_name(msg->lchan);
 	DEBUGP(DRLL, "%s SAPI=%u ", ts_name, sapi);
 	
@@ -2286,7 +2291,8 @@
 	char *ts_name;
 	int rc = 0;
 
-	msg->lchan = lchan_lookup(sign_link->trx, rllh->chan_nr);
+	msg->lchan = lchan_lookup(sign_link->trx, rllh->chan_nr,
+				  "Abis RSL rx IPACC: ");
 	ts_name = gsm_lchan_name(msg->lchan);
 	
 	switch (rllh->c.msg_type) {

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

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



More information about the gerrit-log mailing list