Skip to content

Commit feb41ee

Browse files
authored
Merge pull request #2950 from espressif/fix/ncm_buffer_validation
fix(ncm): Return invalid NTBs to free list
2 parents 2d7d107 + 6476ff1 commit feb41ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/class/net/ncm_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,8 @@ bool netd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
857857
// - if there is a free receive buffer, initiate reception
858858
if (!recv_validate_datagram(ncm_interface.recv_tinyusb_ntb, xferred_bytes)) {
859859
// verification failed: ignore NTB and return it to free
860-
TU_LOG_DRV("(EE) VALIDATION FAILED. WHAT CAN WE DO IN THIS CASE?\n");
860+
TU_LOG_DRV("Invalid datatagram. Ignoring NTB\n");
861+
recv_put_ntb_into_free_list(ncm_interface.recv_tinyusb_ntb);
861862
} else {
862863
// packet ok -> put it into ready list
863864
recv_put_ntb_into_ready_list(ncm_interface.recv_tinyusb_ntb);

0 commit comments

Comments
 (0)