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:
Sylvain Rochet
2016-11-05 21:34:23 +01:00
parent 5d22679c67
commit dde55c6c0e
2 changed files with 4 additions and 7 deletions

View File

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