From ddac5b18955752dd0a25299347d5ea92da411d60 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 26 Jun 2016 22:51:40 +0200 Subject: [PATCH] PPP: introduce ppp_set_listen_time Wait for up to the specified milliseconds for a valid PPP packet from the peer. At the end of this time, or when a valid PPP packet is received from the peer, we commence negotiation by sending our first LCP packet. This is useful because PPP does not deal properly when both peers are sending the first LCP packet in the exact same time, which causes delays because they both wait for a reply for their own packet. --- src/include/netif/ppp/ppp.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index 1ed10298..99b8aeae 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -482,6 +482,13 @@ void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *pas #endif /* LWIP_DNS */ #endif /* PPP_IPV4_SUPPORT */ +/* + * Wait for up to intval milliseconds for a valid PPP packet from the peer. + * At the end of this time, or when a valid PPP packet is received from the + * peer, we commence negotiation by sending our first LCP packet. + */ +#define ppp_set_listen_time(ppp, intval) (ppp->settings.listen_time = intval) + /* * Set a PPP interface as the default network interface * (used to output all packets for which no specific route is found).