From c8db96705fb0dc06f7bc5e89f9a128d8d8a6ab62 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 19 Apr 2015 02:27:40 +0200 Subject: [PATCH] PPP, MPPE, close current session using lcp_close() if something went wrong --- src/netif/ppp/mppe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/netif/ppp/mppe.c b/src/netif/ppp/mppe.c index 2d7bb629..f199a8bc 100644 --- a/src/netif/ppp/mppe.c +++ b/src/netif/ppp/mppe.c @@ -131,6 +131,7 @@ mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) else { PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, pcb->netif->num)); + lcp_close(pcb, "MPPE required but peer negotiation failed"); return; } if (options & MPPE_OPT_STATEFUL) @@ -312,7 +313,7 @@ mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb) * We don't want to do this for a single or just a few * instances since it could just be due to packet corruption. */ - /* FIXME: call lcp_close() here */ + lcp_close(pcb, "Too many MPPE errors"); return ERR_BUF; }