Max has submitted this change and it was merged. Change subject: Log lapd_datalink state on errors ......................................................................
Log lapd_datalink state on errors It's not very useful to get just the raw pointer address in case of lapd_datalink receive error. Log it's state in addition. Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 --- M src/gsm/lapd_core.c 1 file changed, 5 insertions(+), 5 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 5d87154..a2ff230 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1505,7 +1505,7 @@ /* G.2.2 Wrong value of the C/R bit */ if (lctx->cr == dl->cr.rem2loc.resp) { LOGP(DLLAPD, LOGL_ERROR, - "I frame response not allowed (dl=%p)\n", dl); + "I frame response not allowed (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_FRM_UNIMPL, lctx); return -EINVAL; @@ -1517,7 +1517,7 @@ * primitive with cause "I frame with incorrect length" * is sent to the mobile management entity. */ LOGP(DLLAPD, LOGL_ERROR, - "I frame length not allowed (dl=%p)\n", dl); + "I frame length not allowed (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_LEN, lctx); return -EIO; @@ -1529,7 +1529,7 @@ * mobile management entity. */ if (lctx->more && length < lctx->n201) { LOGP(DLLAPD, LOGL_ERROR, - "I frame with M bit too short (dl=%p)\n", dl); + "I frame with M bit too short (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_MBITS, lctx); return -EIO; @@ -1545,7 +1545,7 @@ case LAPD_STATE_SABM_SENT: case LAPD_STATE_DISC_SENT: LOGP(DLLAPD, LOGL_NOTICE, - "I frame ignored in this state (dl=%p)\n", dl); + "I frame ignored in state %s (dl=%p)\n", lapd_state_name(dl->state), dl); msgb_free(msg); return 0; } @@ -1553,7 +1553,7 @@ /* 5.7.1: N(s) sequence error */ if (ns != dl->v_recv) { LOGP(DLLAPD, LOGL_NOTICE, "N(S) sequence error: N(S)=%u, " - "V(R)=%u (dl=%p)\n", ns, dl->v_recv, dl); + "V(R)=%u (dl=%p state %s)\n", ns, dl->v_recv, dl, lapd_state_name(dl->state)); /* discard data */ msgb_free(msg); if (dl->seq_err_cond != 1) { -- To view, visit https://gerrit.osmocom.org/5829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max <msur...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max <msur...@sysmocom.de>