aboutsummaryrefslogtreecommitdiff
path: root/extmod/modlwip.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-04-03 16:43:44 +1100
committerDamien George <damien.p.george@gmail.com>2019-04-03 16:43:44 +1100
commit3dda9647855b6e7ca265d77027d8eefc143a74b9 (patch)
tree2b38afe116fc4edd61fbf1ae777d503fb0afe8a2 /extmod/modlwip.c
parent1f5d945afa20a2d780b8197ce1dd1d5cfd05724b (diff)
extmod/modlwip: Use correct listening socket object in accept callback.
Since commit da938a83b587c7387b8849f795f3497735d14267 the tcp_arg() that is set for the new connection is the new connection itself, and the parent listening socket is found in the pcb->connected entry.
Diffstat (limited to 'extmod/modlwip.c')
-rw-r--r--extmod/modlwip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c
index af19648a6..7ebfa8904 100644
--- a/extmod/modlwip.c
+++ b/extmod/modlwip.c
@@ -447,7 +447,8 @@ STATIC err_t _lwip_tcp_recv_unaccepted(void *arg, struct tcp_pcb *pcb, struct pb
// from accept callback itself.
STATIC err_t _lwip_tcp_accept_finished(void *arg, struct tcp_pcb *pcb)
{
- lwip_socket_obj_t *socket = (lwip_socket_obj_t*)arg;
+ // The ->connected entry of the pcb holds the listening socket of the accept
+ lwip_socket_obj_t *socket = (lwip_socket_obj_t*)pcb->connected;
tcp_poll(pcb, NULL, 0);
exec_user_callback(socket);
return ERR_OK;