diff --git a/src/core/tcp.c b/src/core/tcp.c index 46927072..c98c43f5 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -672,11 +672,11 @@ tcp_bind(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) if (ipaddr == NULL) { ipaddr = IP4_ADDR_ANY; } +#else /* LWIP_IPV4 */ + LWIP_ERROR("tcp_bind: invalid ipaddr", ipaddr != NULL, return ERR_ARG); #endif /* LWIP_IPV4 */ - /* still need to check for ipaddr == NULL in IPv6 only case */ LWIP_ERROR("tcp_bind: invalid pcb", pcb != NULL, return ERR_ARG); - LWIP_ERROR("tcp_bind: invalid ipaddr", ipaddr != NULL, return ERR_ARG); LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL); diff --git a/src/core/udp.c b/src/core/udp.c index ac0e4d6e..9d2cb4af 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -944,11 +944,11 @@ udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) if (ipaddr == NULL) { ipaddr = IP4_ADDR_ANY; } +#else /* LWIP_IPV4 */ + LWIP_ERROR("udp_bind: invalid ipaddr", ipaddr != NULL, return ERR_ARG); #endif /* LWIP_IPV4 */ - /* still need to check for ipaddr == NULL in IPv6 only case */ LWIP_ERROR("udp_bind: invalid pcb", pcb != NULL, return ERR_ARG); - LWIP_ERROR("udp_bind: invalid ipaddr", ipaddr != NULL, return ERR_ARG); LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_bind(ipaddr = ")); ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE, ipaddr);