pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29467 )
Change subject: osmux: Improve logging non-usual conditions ......................................................................
osmux: Improve logging non-usual conditions
Change-Id: I854b0ae78e7e701ec3cb0525063f7292185d05a3 --- M src/osmux.c 1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/67/29467/1
diff --git a/src/osmux.c b/src/osmux.c index 5515e88..f54de7f 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -686,8 +686,10 @@ batch->ndummy--; } amr_payload_len = osmux_rtp_amr_payload_len(msg, rtph); - if (amr_payload_len < 0) + if (amr_payload_len < 0) { + LOGP(DLMUX, LOGL_NOTICE, "AMR payload invalid\n"); return -1; + }
/* First check if there is room for this message in the batch */ bytes += amr_payload_len; @@ -769,18 +771,22 @@ * to avoid a possible forever loop in the caller. */ if (msg->len > h->batch_size - sizeof(struct osmux_hdr)) { + LOGP(DLMUX, LOGL_NOTICE, "RTP payload too big (%u) for configured batch size (%u)\n", + msg->len, h->batch_size); msgb_free(msg); return 0; }
rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) { + LOGP(DLMUX, LOGL_NOTICE, "msg not containing an RTP header\n"); msgb_free(msg); return 0; }
switch(rtph->payload_type) { case RTP_PT_RTCP: + LOGP(DLMUX, LOGL_INFO, "Dropping RTCP packet\n"); msgb_free(msg); return 0; default: @@ -797,6 +803,7 @@ * Malformed, duplicated, OOM. Drop it and tell * the upper layer that we have digest it. */ + LOGP(DLMUX, LOGL_DEBUG, "Dropping RTP packet instead of adding to batch\n"); msgb_free(msg); return 0; }