mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-05 06:39:52 +00:00
PPP, IPCP: fix reset state before reconnecting
Commit 7df5496e7b revealed a regression introduced in commit 5a71509353 which broke IPCP reset state. ask_for_local was set to 0 if ouraddr initial value is 0, if ask_for_local was false go->ouraddr was cleared in reset callback, commit 5a71509353 breaks it by removing this clearing. This regression was silent because the whole ppp pcb runtime data was cleared before reconnecting until commit 7df5496e7b which removed this giant clearing. Fix it by reintroducing ask_for_local boolean value, with proper initial value following what unused function ip_check_options do. Fixes: 7df5496e7b ("PPP, rework initial/reconnect cleanup") Fixes: 5a71509353 ("PPP, CORE, IPCP: removed useless ask_for_local boolean")
This commit is contained in:
parent
5d22679c67
commit
dde55c6c0e
@ -324,6 +324,7 @@ struct ppp_pcb_s {
|
||||
|
||||
/* flags */
|
||||
#if PPP_IPV4_SUPPORT
|
||||
unsigned int ask_for_local :1; /* request our address from peer */
|
||||
unsigned int ipcp_is_open :1; /* haven't called np_finished() */
|
||||
unsigned int ipcp_is_up :1; /* have called ipcp_up() */
|
||||
unsigned int if4_up :1; /* True when the IPv4 interface is up. */
|
||||
@ -475,7 +476,8 @@ void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *pas
|
||||
*
|
||||
* Default is unset (0.0.0.0).
|
||||
*/
|
||||
#define ppp_set_ipcp_ouraddr(ppp, addr) (ppp->ipcp_wantoptions.ouraddr = ip4_addr_get_u32(addr))
|
||||
#define ppp_set_ipcp_ouraddr(ppp, addr) do { ppp->ipcp_wantoptions.ouraddr = ip4_addr_get_u32(addr); \
|
||||
ppp->ask_for_local = ppp->ipcp_wantoptions.ouraddr != 0; } while(0)
|
||||
#define ppp_set_ipcp_hisaddr(ppp, addr) (ppp->ipcp_wantoptions.hisaddr = ip4_addr_get_u32(addr))
|
||||
#if LWIP_DNS
|
||||
/*
|
||||
|
@ -728,13 +728,8 @@ static void ipcp_resetci(fsm *f) {
|
||||
wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */
|
||||
#endif /* LWIP_DNS */
|
||||
*go = *wo;
|
||||
#if 0 /* UNUSED */
|
||||
/* We don't need ask_for_local, this is only useful for setup which
|
||||
* can determine the local IP address from the system hostname.
|
||||
*/
|
||||
if (!ask_for_local)
|
||||
if (!pcb->ask_for_local)
|
||||
go->ouraddr = 0;
|
||||
#endif /* UNUSED */
|
||||
#if 0 /* UNUSED */
|
||||
if (ip_choose_hook) {
|
||||
ip_choose_hook(&wo->hisaddr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user