summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rfid_proto_tcl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rfid_proto_tcl.c b/src/rfid_proto_tcl.c
index 66f1edd..b7577e3 100644
--- a/src/rfid_proto_tcl.c
+++ b/src/rfid_proto_tcl.c
@@ -517,11 +517,6 @@ tcl_transceive(struct rfid_protocol_handle *h,
unsigned char ack[10];
unsigned int ack_len;
- if (tx_len > max_net_tx_framesize(th)) {
- /* slow path: we need to use chaining */
- return -1;
- }
-
tx_buf = malloc(tcl_prlg_len(th) + tx_len);
if (!tx_buf) {
ret = -ENOMEM;
@@ -546,6 +541,12 @@ tcl_transceive(struct rfid_protocol_handle *h,
_rx_len = *rx_len;
*rx_len = 0;
+
+ if (_tx_len > max_net_tx_framesize(th)+prlg_len) {
+ /* slow path: we need to use chaining */
+ _tx_len = max_net_tx_framesize(th)+prlg_len;
+ }
+
do_tx:
ret = rfid_layer2_transceive(h->l2h, l2_to_frame(h->l2h->l2->id),
_tx, _tx_len,
personal git repositories of Harald Welte. Your mileage may vary