From daeda5020dc39dfc2d948968ae0922005205c00d Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Sun, 7 Aug 2016 16:20:49 +0000 Subject: [PATCH] Fix compilation for LWIP_EVENT_API Without LWIP_CALLBACK_API, is no error callback function pointer in the TCP PCB, nor is it needed, so do not attempt to access it. --- src/core/tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/tcp.c b/src/core/tcp.c index 09286e6..f11c81c 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1094,7 +1094,9 @@ tcp_slowtmr_start: /* If the PCB should be removed, do it. */ if (pcb_remove) { struct tcp_pcb *pcb2; +#if LWIP_CALLBACK_API tcp_err_fn err_fn; +#endif /* LWIP_CALLBACK_API */ void *err_arg; tcp_pcb_purge(pcb); /* Remove PCB from tcp_active_pcbs list. */ @@ -1112,7 +1114,9 @@ tcp_slowtmr_start: pcb->local_port, pcb->remote_port); } +#if LWIP_CALLBACK_API err_fn = pcb->errf; +#endif /* LWIP_CALLBACK_API */ err_arg = pcb->callback_arg; pcb2 = pcb; pcb = pcb->next; -- 2.5.2