don't call ppp_hup() and ppp_stop() if PPPoE or PPPoL2TP failed to connect

This is useless because PPP is not started yet, it confuses the PPP phase
state machine.
This commit is contained in:
Sylvain Rochet 2012-07-22 23:37:35 +02:00
parent 5552f082e8
commit 8ec92b6fe7

View File

@ -1950,6 +1950,8 @@ static void ppp_over_ethernet_link_status_cb(ppp_pcb *pcb, int state) {
case PPPOE_CB_STATE_DOWN:
PPPDEBUG(LOG_INFO, ("ppp_over_ethernet_link_status_cb: unit %d: DOWN, disconnected\n", pcb->num));
pppoe_err_code = PPPERR_CONNECT;
ppp_hup(pcb);
ppp_stop(pcb);
break;
/* PPPoE link failed to setup (i.e. PADI/PADO timeout) */
@ -1959,8 +1961,6 @@ static void ppp_over_ethernet_link_status_cb(ppp_pcb *pcb, int state) {
break;
}
ppp_hup(pcb);
ppp_stop(pcb);
if (pcb->link_status_cb) {
pcb->link_status_cb(pcb, pcb->err_code ? pcb->err_code : pppoe_err_code, pcb->link_status_ctx);
}
@ -2001,6 +2001,8 @@ static void ppp_over_l2tp_link_status_cb(ppp_pcb *pcb, int state) {
case PPPOL2TP_CB_STATE_DOWN:
PPPDEBUG(LOG_INFO, ("ppp_over_l2tp_link_status_cb: unit %d: DOWN, disconnected\n", pcb->num));
pppol2tp_err_code = PPPERR_CONNECT;
ppp_hup(pcb);
ppp_stop(pcb);
break;
/* PPPoL2TP link failed to setup (i.e. L2TP timeout) */
@ -2010,8 +2012,6 @@ static void ppp_over_l2tp_link_status_cb(ppp_pcb *pcb, int state) {
break;
}
ppp_hup(pcb);
ppp_stop(pcb);
if (pcb->link_status_cb) {
pcb->link_status_cb(pcb, pcb->err_code ? pcb->err_code : pppol2tp_err_code, pcb->link_status_ctx);
}