[MERGED] 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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Sep 17 09:58:54 UTC 2016


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

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



diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index d3d9f9e..dc4ede2 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)
@@ -1452,7 +1454,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) {
@@ -1813,7 +1816,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:
@@ -1914,7 +1918,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);
 	
@@ -2308,7 +2313,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: merged
Gerrit-Change-Id: Id81e7b8b9c27831923f050a78dfc7d650e687033
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list