cardemu: Fix interpretation of MSGC_MODEM messages

msg->l2h should always point at the first byte of the header after the
generic simtrace header.  For some reason this doesn't work if used
globally, but it is required for the MSGC_MODEM messages to be
interpreted correctly.
This commit is contained in:
Harald Welte 2017-05-11 01:11:43 +02:00
parent 253991789a
commit 23c00b6ad3
1 changed files with 3 additions and 0 deletions

View File

@ -577,6 +577,9 @@ static void dispatch_usb_command(struct msgb *msg, struct cardem_inst *ci)
dispatch_usb_command_cardem(msg, ci);
break;
case SIMTRACE_MSGC_MODEM:
/* FIXME: Find out why this fails if used for !=
* MSGC_MODEM ?!? */
msg->l2h = msg->l1h + sizeof(*sh);
dispatch_usb_command_modem(msg, ci);
break;
default: