mirror of
https://github.com/esphome/esphome.git
synced 2026-09-22 20:48:43 +00:00
tweaks
This commit is contained in:
@@ -1259,11 +1259,10 @@ ssize_t LWIPRawUDPRecvImpl::recvfrom(void *buf, size_t len, struct sockaddr *src
|
||||
// Fill in source address if requested.
|
||||
// If ip2sockaddr_ fails (e.g., addrlen too small), fail the entire recvfrom
|
||||
// rather than silently returning data without a source address.
|
||||
if (src_addr != nullptr && addrlen != nullptr) {
|
||||
if (this->ip2sockaddr_(&pkt.src_addr, pkt.src_port, src_addr, addrlen) != 0) {
|
||||
// Put the packet back — don't consume it on address conversion failure
|
||||
return -1;
|
||||
}
|
||||
if (src_addr != nullptr && addrlen != nullptr &&
|
||||
this->ip2sockaddr_(&pkt.src_addr, pkt.src_port, src_addr, addrlen) != 0) {
|
||||
// Don't consume the packet on address conversion failure
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Free the pbuf and advance the read pointer
|
||||
|
||||
Reference in New Issue
Block a user