Skip to content

Commit d883bbe

Browse files
committed
Dynamic MTU: fix some size computation
In some places, even if mtu size is dynamic, MAX_APDU_DSAP_SIZE must still be used as it allow to obtain some structure header size (full struct - statically reserved payload size)
1 parent 2ed61c1 commit d883bbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/wpc/dsap.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ int dsap_data_tx_request(const uint8_t * buffer,
217217
request.primitive_id = DSAP_DATA_TX_TT_REQUEST;
218218
fill_tx_tt_request(&request, buffer, len, pdu_id, dest_add, qos, src_ep, dest_ep, tx_options, buffering_delay);
219219
request.payload_length =
220-
sizeof(dsap_data_tx_tt_req_pl_t) - (max_data_pdu_size - len);
220+
sizeof(dsap_data_tx_tt_req_pl_t) - (MAX_APDU_DSAP_SIZE - len);
221221

222222
// Do the sending
223223
res = WPC_Int_send_request(&request, &confirm);
@@ -257,7 +257,7 @@ int dsap_data_tx_request(const uint8_t * buffer,
257257
last);
258258

259259
request.payload_length =
260-
sizeof(dsap_data_tx_frag_req_pl_t) - (max_data_pdu_size - frag_len);
260+
sizeof(dsap_data_tx_frag_req_pl_t) - (MAX_APDU_DSAP_SIZE - frag_len);
261261

262262
// Do the sending
263263
res = WPC_Int_send_request(&request, &confirm);

0 commit comments

Comments
 (0)