Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10218 )

Change subject: remsim: fix payload overwriting
......................................................................

remsim: fix payload overwriting

The slot number is in the header, and correctly set in st_push_hdr.
Setting the slot in st_slot_tx_msg will overwrite the payload data.
This caused bytes three of the ATR to be changed from 0x96 to 0x00,
corrupting the ATR. This corruption is caught by the ATR checksum,
and the modem would reset the card (2 additional times) to try to
get correct ATR.

Change-Id: If971699993617fc50557d20582c344ea06645a3f
---
M host/simtrace2-remsim.c
1 file changed, 0 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index 462f73e..52c5051 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -173,16 +173,11 @@
 int st_slot_tx_msg(struct st_slot *slot, struct msgb *msg,
                   uint8_t msg_class, uint8_t msg_type)
 {
-       struct simtrace_msg_hdr *sh = (struct simtrace_msg_hdr *) msg->data;
-
-       sh->slot_nr = slot->slot_nr;
-
        st_push_hdr(msg, msg_class, msg_type, slot->slot_nr);

        return st_transp_tx_msg(slot->transp, msg);
 }

-
 /***********************************************************************
  * Card Emulation protocol
  ***********************************************************************/

--
To view, visit https://gerrit.osmocom.org/10218
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f
Gerrit-Change-Number: 10218
Gerrit-PatchSet: 4
Gerrit-Owner: Kévin Redon <kre...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Kévin Redon <kre...@sysmocom.de>

Reply via email to