osmux: Fix reception of legacy dummy payloads

Size check had a bug. Take the opportunity to print wrong frames on
error.

Change-Id: I9f0d4e28a2019c7ad94344f2c34d17c365bebea9
This commit is contained in:
Pau Espin Pedrol
2019-05-13 12:58:24 +02:00
parent 6c1cd63a57
commit b5583cde41

View File

@@ -348,9 +348,9 @@ static int endp_osmux_state_check(struct mgcp_endpoint *endp, struct mgcp_conn_r
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;
}