net: l2: ppp: Allow PPP to transtition ESTABLISH->DEAD #99078
+17
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



When remote peer have closed the PPP link normally (LCP Terminate-Request), the PPP stack on Zephyr side switches back to ESTABLISH phase to be ready for next handshake.
When calling net_if_down() on the interface, it should not try to initiate LCP link termination, but instead go directly to DEAD phase.
See https://datatracker.ietf.org/doc/html/rfc1661#section-3.2
ESTABLISH->DEAD is a valid transition.
It does not have to go to ESTABLISH->TERMINATE->DEAD.
Without this change, the
net_if_down()waits forCONFIG_NET_L2_PPP_TIMEOUTuntil returning if the link was already closed by the remote peer. If the link was up, the termination is faster as peer is responding.This is because when reaching the
DEADphase, thelcp_down()returns toESTABLISHif we still indicate carrier is OK.https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/l2/ppp/lcp.c#L208-L210
This delay basically only affects the peer which is serving the connection (PPP server/modem).