net: l2: ppp: Don't attempt reestablish PPP if carrier is down

This commit adds a check to prevent attempting to reestablish
the PPP session if the carrier is down. Without this check,
the PPP FSM attempts and fails to establish a PPP session
twice before giving up. The behavior is not breaking anything,
but it is not desired.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit is contained in:
Bjarki Arge Andreasen 2023-09-29 12:26:48 +02:00 committed by Carles Cufí
commit d6a96a4b24

View file

@ -179,6 +179,10 @@ static void lcp_down(struct ppp_fsm *fsm)
ppp_link_down(ctx);
if (!net_if_is_carrier_ok(ctx->iface)) {
return;
}
ppp_change_phase(ctx, PPP_ESTABLISH);
}