[MERGED] libosmocore[master]: LAPD: improve logging

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jan 10 23:28:40 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: LAPD: improve logging
......................................................................


LAPD: improve logging

Log error cause and state names in case of SABM errors.

Change-Id: I2c7fa276e03f8b14ba41cc1fb6e19d0aae77d127
---
M src/gsm/lapd_core.c
1 file changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index fd163c8..cdd9b56 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -377,8 +377,8 @@
 	struct lapd_datalink *dl = lctx->dl;
 	struct osmo_dlsap_prim dp;
 
-	LOGP(DLLAPD, LOGL_NOTICE, "sending MDL-ERROR-IND cause %d\n",
-		cause);
+	LOGP(DLLAPD, LOGL_NOTICE, "sending MDL-ERROR-IND cause %s\n",
+	     rsl_rlm_cause_name(cause));
 	osmo_prim_init(&dp.oph, 0, PRIM_MDL_ERROR, PRIM_OP_INDICATION, NULL);
 	dp.u.error_ind.cause = cause;
 	return dl->send_dlsap(&dp, lctx);
@@ -833,7 +833,8 @@
 			}
 			if (!dl->cont_res) {
 				LOGP(DLLAPD, LOGL_INFO, "SABM command not "
-						"allowed in this state\n");
+				     "allowed in state %s\n",
+				     lapd_state_names[dl->state]);
 				mdl_error(MDL_CAUSE_SABM_MF, lctx);
 				msgb_free(msg);
 				return 0;
@@ -870,7 +871,8 @@
 			/* check for contention resoultion */
 			if (dl->tx_hist[0].msg && dl->tx_hist[0].msg->len) {
 				LOGP(DLLAPD, LOGL_NOTICE, "SABM not allowed "
-					"during contention resolution\n");
+				     "during contention resolution (state %s)\n",
+				     lapd_state_names[dl->state]);
 				mdl_error(MDL_CAUSE_SABM_INFO_NOTALL, lctx);
 			}
 			lapd_send_ua(lctx, length, msg->l3h);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c7fa276e03f8b14ba41cc1fb6e19d0aae77d127
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list