Skip to content

Commit 800b93d

Browse files
lzungrixiaoxiang781216
authored andcommitted
ppp: Fix wrong lcp_state handling on peer reconnection
If a PPP peer disconnects and then tries to reconnect it will send an 'LCP configure request' packet. The code that handles that scenario seems to be clearing the wrong lcp_state flag (LCP_RX_UP instead of LCP_TX_UP) and thus the nuttx ppp client will keep sending IPCP packets which are rightfully dropped by the new peer since it is still in the LCP negotiation phase.
1 parent f96461c commit 800b93d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

netutils/pppd/lcp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count)
135135
/* In case of new peer connection */
136136

137137
ipcp_init(ctx);
138-
ctx->lcp_state &= ~LCP_RX_UP;
138+
139+
/* Clear LCP state to keep it in negotiation phase. LCP_TX_UP will be re-set
140+
* once a CONF_ACK is received. */
141+
142+
ctx->lcp_state &= ~LCP_TX_UP;
139143

140144
DEBUG1(("received [LCP Config Request id %u\n", id));
141145
if (scan_packet

0 commit comments

Comments
 (0)