Hi, On Thu, May 16, 2019 at 07:51:45PM +0200, [email protected] wrote: > Am 16.05.2019 um 18:31 schrieb Freddie Chopin: > >Hello Devanand! > > > >On Thu, 2019-05-16 at 20:41 +0530, Devanand Biradar wrote: > >>I have connected to mosquito cloud using Lwip via MQTT. > >>Using PPPOS with GSM module. > > > >Yes, I know this can be done, because I already have done it and it > >works (; But now I would like to make it more error-proof and > >responsive - my code so far is just a dirty proof-of-concept using > >stupid things like global flags and polling. > > > >So what I'm asking is this - is it safe to have code like this: > > It's probably not safe as you risk calling back into modules that are > not reentrant. I don't know this for sure, just as a saftey measurement...
Hummm, I guess it's safe, I doubt PPP status callback can actually be
called from a module.
Looking at the code it can only be called:
- Right from ppp_close(), only if the session is already dead;
- If the lower level link failed to setup, i.e. timeout. in
ppp_link_failed();
- If the link is shutting down, i.e. timeout or LCP "Term" packet
received in ppp_link_end();
- If the link is UP, after a packet is received, in sifup() and
sif6up().
Unless you are calling ppp_close() from a module, which I highly doubt,
it is safe because other triggers are only rx packet or timeouts.
Sylvain
signature.asc
Description: Digital signature
_______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
