lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] TCP Client system fault


From: address@hidden
Subject: Re: [lwip-devel] TCP Client system fault
Date: Mon, 07 May 2012 22:24:52 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

Vinicius Bernardi wrote:
I'm calling sigHUP from the same thread that manage all PPP stuff.

That doesn't mean it's correct. Please have a close look at the current PPP code (versions before 1.4.0 had threading bugs in the ppp input path, so please ensure you take at least 1.4.0 as a reference!). You will find that only the unescaping is done in a separate ppp input thread (plus receiving bytes, but your sio implementation has to be thread safe then, to allow RX and TX to happen from different threads!).

Once a packet is unescaped, it is passed into the tcpip_thread by calling pppInput() via tcpip_callback(). Note that pppSigHup() (if that's what you mean by 'sigHUP') is *not* called from this thread in the original lwIP sources (in fact, it's not called from anywhere).

Now I don't know if the commented code it's necessary or not, but following the same way, there is no reason to depend's on that code, if the callback functions are optional.

The callback function where you removed code from is *not* optional, it is a vital part of TCP netconns/sockets to work. I'm guessing you mean the callback function that can be passed to netconn_new_with_callback(), but that's a totally different callback. Believe me when I assure you the code you removed *is* necessary and if an ACK can come in while a write is being processed, your threading is messed up!

Simon

reply via email to

[Prev in Thread] Current Thread [Next in Thread]