From 9a707153719b5c8afbf9c29f2efe588926e3c3cb Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 26 Jun 2016 22:37:41 +0200 Subject: [PATCH] PPP, SERVER: move silent mode set from pppos_listen to ppp_listen This flag would be required for any low level protocol used. Move it from pppos_listen to ppp_listen. --- src/netif/ppp/ppp.c | 6 ++++++ src/netif/ppp/pppos.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 1fb9566e..e5630b81 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -278,12 +278,18 @@ err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff) { * established before calling this. */ err_t ppp_listen(ppp_pcb *pcb) { + lcp_options *lcp_wo; + if (pcb->phase != PPP_PHASE_DEAD) { return ERR_ALREADY; } PPPDEBUG(LOG_DEBUG, ("ppp_listen[%d]\n", pcb->netif->num)); + /* Wait passively */ + lcp_wo = &pcb->lcp_wantoptions; + lcp_wo->silent = 1; + if (pcb->link_cb->listen) { return pcb->link_cb->listen(pcb, pcb->link_ctx_cb); } diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index 0ecbec7a..d2aa97d4 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -335,7 +335,6 @@ static err_t pppos_listen(ppp_pcb *ppp, void *ctx) { pppos_pcb *pppos = (pppos_pcb *)ctx; - lcp_options *lcp_wo; PPPOS_DECL_PROTECT(lev); #if PPP_INPROC_IRQ_SAFE @@ -347,10 +346,6 @@ pppos_listen(ppp_pcb *ppp, void *ctx) /* reset PPPoS control block to its initial state */ memset(&pppos->last_xmit, 0, sizeof(pppos_pcb) - ( (char*)&((pppos_pcb*)0)->last_xmit - (char*)0 ) ); - /* Wait passively */ - lcp_wo = &ppp->lcp_wantoptions; - lcp_wo->silent = 1; - /* * Default the in and out accm so that escape and flag characters * are always escaped.