mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
handle cases when ppp_close() is called while session is in dead or holdoff phase
This commit is contained in:
parent
3c122117fc
commit
5552f082e8
@ -519,6 +519,19 @@ ppp_close(ppp_pcb *pcb)
|
|||||||
{
|
{
|
||||||
int st = 0;
|
int st = 0;
|
||||||
|
|
||||||
|
/* dead phase, nothing to do, call the status callback to be consistent */
|
||||||
|
if (pcb->phase == PHASE_DEAD) {
|
||||||
|
pcb->link_status_cb(pcb, PPPERR_USER, pcb->link_status_ctx);
|
||||||
|
return PPPERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* holdoff phase, cancel the reconnection and call the status callback */
|
||||||
|
if (pcb->phase == PHASE_HOLDOFF) {
|
||||||
|
sys_untimeout(ppp_do_reopen, pcb);
|
||||||
|
pcb->link_status_cb(pcb, PPPERR_USER, pcb->link_status_ctx);
|
||||||
|
return PPPERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
PPPDEBUG(LOG_DEBUG, ("ppp_close() called\n"));
|
PPPDEBUG(LOG_DEBUG, ("ppp_close() called\n"));
|
||||||
pcb->settings.persist = 0; /* FIXME: not necessary anymore since persistence is done through link status callback */
|
pcb->settings.persist = 0; /* FIXME: not necessary anymore since persistence is done through link status callback */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user