tabascoeye / lwip

a fork of the light-weight IP stack
Other
15 stars 6 forks source link

sockets are not thread-safe #8

Open tabascoeye opened 10 years ago

tabascoeye commented 10 years ago

When a socket is used from different tasks at the same time, the stack behavior is basically undefined.

To slowly work towards the goal of having a thread-safe stack that is still "light weight", we'll try to do the following bits:

tabascoeye commented 10 years ago

found another possible race condition when using sockets from multiple thread contexts: the setsockopt calls are handled via a tcpip_callback() so it can happen that the stack only processes them when the socket itself is already closed. Then, inside the lwip_setsockopt_internal() function, writes to NULL pointers are made on sock->conn->pcb.ip