PPP: cleanup

Code cleaning only (misleading indents or comments, etc.), no behavior
change.
This commit is contained in:
Sylvain Rochet 2020-10-17 16:01:00 +02:00
parent bedb4e4745
commit 88ac7460f0
2 changed files with 11 additions and 26 deletions

View File

@ -963,6 +963,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
#endif /* PPP_PROTOCOLNAME */
ppp_warn(("Unsupported protocol 0x%x received", protocol));
#endif /* PPP_DEBUG */
if (pbuf_add_header(pb, sizeof(protocol))) {
PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping (pbuf_add_header failed)\n", pcb->netif->num));
goto drop;

View File

@ -502,6 +502,7 @@ pppos_input(ppp_pcb *ppp, u8_t *s, int l)
}
escaped = ESCAPE_P(pppos->in_accm, cur_char);
PPPOS_UNPROTECT(lev);
/* Handle special characters. */
if (escaped) {
/* Check for escape sequences. */
@ -598,42 +599,25 @@ pppos_input(ppp_pcb *ppp, u8_t *s, int l)
if (cur_char != PPP_ALLSTATIONS) {
break;
}
/* no break */
/* Fall through */
case PDSTART: /* Process start flag. */
/* Prepare for a new packet. */
pppos->in_fcs = PPP_INITFCS;
/* no break */
/* Fall through */
case PDADDRESS: /* Process address field. */
if (cur_char == PPP_ALLSTATIONS) {
pppos->in_state = PDCONTROL;
break;
}
/* no break */
/* Else assume compressed address and control fields so
* fall through to get the protocol... */
/* Fall through */
case PDCONTROL: /* Process control field. */
/* If we don't get a valid control code, restart. */
if (cur_char == PPP_UI) {
pppos->in_state = PDPROTOCOL1;
break;
}
/* no break */
#if 0
else {
PPPDEBUG(LOG_WARNING,
("pppos_input[%d]: Invalid control <%d>\n", ppp->netif->num, cur_char));
pppos->in_state = PDSTART;
}
#endif
/* Fall through */
case PDPROTOCOL1: /* Process protocol field 1. */
/* If the lower bit is set, this is the end of the protocol
* field. */