PPP: Fix shadowing of global declaration

Older compilers (GCC 4.6) don't like variables with the same name as
global functions:

lwip/src/netif/ppp/lcp.c: In function 'lcp_received_echo_reply':
lwip/src/netif/ppp/lcp.c:2685:11: error: declaration of 'magic' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/magic.h:101:7: error: shadowed declaration is here [-Werror=shadow]

magic.h contains a function named magic(), so rename the variable.
This commit is contained in:
Erik Ekman 2015-10-01 10:49:28 +02:00 committed by Sylvain Rochet
parent 495fc61a34
commit 1fef434f01

View File

@ -2682,7 +2682,7 @@ static void LcpEchoTimeout(void *arg) {
static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) { static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) {
ppp_pcb *pcb = f->pcb; ppp_pcb *pcb = f->pcb;
lcp_options *go = &pcb->lcp_gotoptions; lcp_options *go = &pcb->lcp_gotoptions;
u32_t magic; u32_t magic_val;
LWIP_UNUSED_ARG(id); LWIP_UNUSED_ARG(id);
/* Check the magic number - don't count replies from ourselves. */ /* Check the magic number - don't count replies from ourselves. */
@ -2690,9 +2690,9 @@ static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) {
ppp_dbglog("lcp: received short Echo-Reply, length %d", len); ppp_dbglog("lcp: received short Echo-Reply, length %d", len);
return; return;
} }
GETLONG(magic, inp); GETLONG(magic_val, inp);
if (go->neg_magicnumber if (go->neg_magicnumber
&& magic == go->magicnumber) { && magic_val == go->magicnumber) {
ppp_warn("appear to have received our own echo-reply!"); ppp_warn("appear to have received our own echo-reply!");
return; return;
} }