PPP, CORE, fixed callbacks return value

Fixed return value in case of abnormal termination.
Set pcb->err_code in case of failed setup link.
This commit is contained in:
Sylvain Rochet 2015-02-17 22:14:19 +01:00
parent 18074ff98f
commit f7584fa883

View File

@ -487,13 +487,17 @@ void ppp_start(ppp_pcb *pcb) {
void ppp_link_failed(ppp_pcb *pcb) {
PPPDEBUG(LOG_DEBUG, ("ppp_failed: unit %d\n", pcb->num));
new_phase(pcb, PPP_PHASE_DEAD);
pcb->link_status_cb(pcb, PPPERR_OPEN, pcb->ctx_cb);
pcb->err_code = PPPERR_OPEN;
pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb);
}
/** Called when link is normally down (i.e. it was asked to end) */
void ppp_link_end(ppp_pcb *pcb) {
PPPDEBUG(LOG_DEBUG, ("ppp_end: unit %d\n", pcb->num));
pcb->link_status_cb(pcb, PPPERR_CONNECT, pcb->ctx_cb);
if (pcb->err_code == PPPERR_NONE) {
pcb->err_code = PPPERR_CONNECT;
}
pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb);
}
/** LCP close request */