osmux: Fix reception of legacy dummy payloads
Size check had a bug. Take the opportunity to print wrong frames on
error.
Change-Id: I9f0d4e28a2019c7ad94344f2c34d17c365bebea9
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index ce89df1..9c3844f 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -348,9 +348,9 @@
static int osmux_legacy_dummy_parse_cid(struct sockaddr_in *addr, struct msgb *msg,
uint8_t *osmux_cid)
{
- if (msg->len < 1 + sizeof(osmux_cid)) {
+ if (msg->len < 1 + sizeof(*osmux_cid)) {
LOGP(DLMGCP, LOGL_ERROR,
- "Discarding truncated Osmux dummy load\n");
+ "Discarding truncated Osmux dummy load: %s\n", osmo_hexdump(msg->data, msg->len));
return -1;
}