PPP: fix dead phase set too early

When we are disconnecting, we should switch to PPP dead phase at the
very end, because this is our final disconnection phase allowing
reconnect, therefore we should switch to dead phase after the link
protocol finished disconnecting.

We are currently switching to dead phase when LCP detected that the link
is down, this is obviously wrong. Fix this flaw by continuing in
disconnect phase until ppp_link_end is called from link protocol.
This commit is contained in:
Sylvain Rochet 2016-08-04 22:06:45 +02:00
parent 5f774270b6
commit bae67915ab
2 changed files with 1 additions and 1 deletions

View File

@ -639,7 +639,6 @@ void link_terminated(ppp_pcb *pcb) {
lcp_lowerdown(pcb); lcp_lowerdown(pcb);
new_phase(pcb, PPP_PHASE_DEAD);
ppp_link_terminated(pcb); ppp_link_terminated(pcb);
#if 0 #if 0
/* /*

View File

@ -746,6 +746,7 @@ void ppp_link_failed(ppp_pcb *pcb) {
/** Called when link is normally down (i.e. it was asked to end) */ /** Called when link is normally down (i.e. it was asked to end) */
void ppp_link_end(ppp_pcb *pcb) { void ppp_link_end(ppp_pcb *pcb) {
PPPDEBUG(LOG_DEBUG, ("ppp_link_end[%d]\n", pcb->netif->num)); PPPDEBUG(LOG_DEBUG, ("ppp_link_end[%d]\n", pcb->netif->num));
new_phase(pcb, PPP_PHASE_DEAD);
if (pcb->err_code == PPPERR_NONE) { if (pcb->err_code == PPPERR_NONE) {
pcb->err_code = PPPERR_CONNECT; pcb->err_code = PPPERR_CONNECT;
} }