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.
This commit is contained in:
Sylvain Rochet 2016-06-26 22:51:40 +02:00
parent 9a70715371
commit ddac5b1895

View File

@ -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).