mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-19 22:56:57 +08:00
PPP, PPPoS, fixed thread safety of pppos_input()
PPPoS was actually not thread safe, pppos_input() can be called from lwIP user port at any time, whatever the PPP state is. It might even be called during pppos_connect() and pppos_listen(), this is quite unlikely the port do that but nothing prevent the user to since we document pppos_input() as being thread safe. Added a mutex if PPP_INPROC_MULTITHREADED is set and ensure pppos_input() is safe in regard to other pppos_* functions.
This commit is contained in:
@@ -67,6 +67,9 @@ typedef struct pppos_pcb_s pppos_pcb;
|
||||
struct pppos_pcb_s {
|
||||
/* -- below are data that will NOT be cleared between two sessions */
|
||||
ppp_pcb *ppp; /* PPP PCB */
|
||||
#if PPP_INPROC_MULTITHREADED
|
||||
sys_mutex_t mutex; /* Mutex for pppos_input() */
|
||||
#endif /* PPP_INPROC_MULTITHREADED */
|
||||
sio_fd_t fd; /* File device ID of port. */
|
||||
|
||||
/* -- below are data that will be cleared between two sessions
|
||||
|
||||
Reference in New Issue
Block a user