diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 706e2635..301659c1 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -827,14 +827,16 @@ tcp_process(struct tcp_pcb *pcb) if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)) { pcb->state = ESTABLISHED; LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG #if LWIP_CALLBACK_API LWIP_ASSERT("pcb->listener->accept != NULL", (pcb->listener == NULL) || (pcb->listener->accept != NULL)); +#endif if (pcb->listener == NULL) { /* listen pcb might be closed by now */ err = ERR_VAL; } else -#endif +#endif /* LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG */ { tcp_backlog_accepted(pcb); /* Call the accept function. */ diff --git a/src/include/lwip/priv/tcp_priv.h b/src/include/lwip/priv/tcp_priv.h index 03ebcb63..35c90420 100644 --- a/src/include/lwip/priv/tcp_priv.h +++ b/src/include/lwip/priv/tcp_priv.h @@ -179,7 +179,7 @@ err_t tcp_process_refused_data(struct tcp_pcb *pcb); #define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) \ do { \ - if((lpcb != NULL) && ((lpcb)->accept != NULL)) \ + if((lpcb)->accept != NULL) \ (ret) = (lpcb)->accept((arg),(pcb),(err)); \ else (ret) = ERR_ARG; \ } while (0)