PPP, chained returns up to ppp_free()

ppp_free() now returns lower level protocol return value if something failed.
This commit is contained in:
Sylvain Rochet 2015-02-17 23:09:18 +01:00
parent 50ecd2c12c
commit 19fdeae4ba

View File

@ -320,6 +320,7 @@ ppp_sighup(ppp_pcb *pcb)
* Return 0 on success, an error code on failure.
*/
int ppp_free(ppp_pcb *pcb) {
int err;
if (pcb->phase != PPP_PHASE_DEAD) {
return PPPERR_PARAM;
}
@ -328,10 +329,10 @@ int ppp_free(ppp_pcb *pcb) {
netif_remove(pcb->netif);
pcb->link_command_cb(pcb->link_ctx_cb, PPP_LINK_COMMAND_FREE);
err = pcb->link_command_cb(pcb->link_ctx_cb, PPP_LINK_COMMAND_FREE);
memp_free(MEMP_PPP_PCB, pcb);
return 0;
return err;
}
/* Get and set parameters for the given connection.