Skip to content

Commit 9c02134

Browse files
Nari-19yashi
authored andcommitted
interfaces: udp: Accept 0-byte payload packets
Using `<=` caused 0-byte payloads to be dropped, which was unintended. This change ensures such packets are correctly processed. Signed-off-by: Riho Natsushima <[email protected]> Signed-off-by: Yasushi SHOJI <[email protected]>
1 parent f8826f1 commit 9c02134

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interfaces/csp_if_udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int csp_if_udp_rx_work(int sockfd, size_t unused, csp_iface_t * iface) {
4646
int header_size = csp_id_setup_rx(packet);
4747
int received_len = recvfrom(sockfd, (char *)packet->frame_begin, sizeof(packet->data) + header_size, MSG_WAITALL, NULL, NULL);
4848

49-
if (received_len <= header_size) {
49+
if (received_len < header_size) {
5050
csp_buffer_free(packet);
5151
return CSP_ERR_NOMEM;
5252
}

0 commit comments

Comments
 (0)