From 5a715093536a47f55a3c1486a4c990c0d1232966 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Fri, 27 Feb 2015 22:39:42 +0100 Subject: [PATCH] PPP, CORE, IPCP: removed useless ask_for_local boolean We don't need ask_for_local boolean, this is only useful for setup which can determine the local IP address from the system hostname, which is probably meaningless for embedded devices (and probably any devices). It was actually only set by ip_check_options() which is commented out in lwIP because we don't parse a config file nor check PPP configuration (user is responsible about writing a configuration which is logical ;-). Furthermore ask_for_local boolean never set actually had the wrong default for PPP server setups. --- src/include/netif/ppp/ppp.h | 3 +-- src/netif/ppp/ipcp.c | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index 7c121b16..73916eaf 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -344,9 +344,8 @@ struct ppp_pcb_s { #else unsigned int :2; /* 2 bit of padding */ #endif /* PPP_IPV6_SUPPORT */ - unsigned int ask_for_local :1; /* request our address from peer */ unsigned int lcp_echo_timer_running :1; /* set if a timer is running */ - unsigned int :5; /* 5 bits of padding to round out to 16 bits */ + unsigned int :6; /* 6 bits of padding to round out to 16 bits */ u32_t last_xmit; /* Time of last transmission. */ diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 4e97284f..355483f5 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -721,8 +721,13 @@ static void ipcp_resetci(fsm *f) { wo->req_dns1 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ wo->req_dns2 = pcb->settings.usepeerdns; *go = *wo; - if (!pcb->ask_for_local) +#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) go->ouraddr = 0; +#endif /* UNUSED */ #if 0 /* UNUSED */ if (ip_choose_hook) { ip_choose_hook(&wo->hisaddr);