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.
This commit is contained in:
Sylvain Rochet 2016-06-26 22:37:41 +02:00
parent 96296947fc
commit 9a70715371
2 changed files with 6 additions and 5 deletions

View File

@ -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);
}

View File

@ -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.