Skip to content

Commit 45ac5a8

Browse files
committed
extmod/modlwip: Workaround esp8266 sendto issue where 1 is returned.
1 parent a635423 commit 45ac5a8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

extmod/modlwip.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ STATIC mp_uint_t lwip_udp_send(lwip_socket_obj_t *socket, const byte *buf, mp_ui
379379

380380
pbuf_free(p);
381381

382-
if (err != ERR_OK) {
382+
// udp_sendto can return 1 on occasion for ESP8266 port. It's not known why
383+
// but it seems that the send actually goes through without error in this case.
384+
// So we treat such cases as a success until further investigation.
385+
if (err != ERR_OK && err != 1) {
383386
*_errno = error_lookup_table[-err];
384387
return -1;
385388
}

0 commit comments

Comments
 (0)