diff --git a/src/api/api_lib.c b/src/api/api_lib.c index 73225268..1e356aa0 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -254,10 +254,12 @@ netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port) LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;); +#if LWIP_IPV4 /* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */ if (addr == NULL) { addr = IP4_ADDR_ANY; } +#endif /* LWIP_IPV4 */ #if LWIP_IPV4 && LWIP_IPV6 /* "Socket API like" dual-stack support: If IP to bind to is IP6_ADDR_ANY, @@ -296,10 +298,12 @@ netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port) LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;); +#if LWIP_IPV4 /* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */ if (addr == NULL) { addr = IP4_ADDR_ANY; } +#endif /* LWIP_IPV4 */ API_MSG_VAR_ALLOC(msg); API_MSG_VAR_REF(msg).conn = conn; @@ -881,6 +885,7 @@ netconn_join_leave_group(struct netconn *conn, API_MSG_VAR_ALLOC(msg); +#if LWIP_IPV4 /* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */ if (multiaddr == NULL) { multiaddr = IP4_ADDR_ANY; @@ -888,6 +893,7 @@ netconn_join_leave_group(struct netconn *conn, if (netif_addr == NULL) { netif_addr = IP4_ADDR_ANY; } +#endif /* LWIP_IPV4 */ API_MSG_VAR_REF(msg).conn = conn; API_MSG_VAR_REF(msg).msg.jl.multiaddr = API_MSG_VAR_REF(multiaddr); diff --git a/src/apps/lwiperf/lwiperf.c b/src/apps/lwiperf/lwiperf.c index 1996cd1a..3bdd01c7 100644 --- a/src/apps/lwiperf/lwiperf.c +++ b/src/apps/lwiperf/lwiperf.c @@ -579,7 +579,7 @@ lwiperf_tcp_accept(void *arg, struct tcp_pcb *newpcb, err_t err) void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg) { - return lwiperf_start_tcp_server(IP4_ADDR_ANY, LWIPERF_TCP_PORT_DEFAULT, + return lwiperf_start_tcp_server(IP_ADDR_ANY, LWIPERF_TCP_PORT_DEFAULT, report_fn, report_arg); } diff --git a/src/apps/snmp/snmp_netconn.c b/src/apps/snmp/snmp_netconn.c index 070b41c3..27c004df 100644 --- a/src/apps/snmp/snmp_netconn.c +++ b/src/apps/snmp/snmp_netconn.c @@ -52,7 +52,7 @@ snmp_netconn_thread(void *arg) LWIP_UNUSED_ARG(arg); /* Bind to SNMP port with default IP address */ - #if LWIP_IPV6 +#if LWIP_IPV6 conn = netconn_new(NETCONN_UDP_IPV6); netconn_bind(conn, IP6_ADDR_ANY, SNMP_IN_PORT); #else /* LWIP_IPV6 */ diff --git a/src/apps/sntp/sntp.c b/src/apps/sntp/sntp.c index fb952111..ac69650a 100644 --- a/src/apps/sntp/sntp.c +++ b/src/apps/sntp/sntp.c @@ -688,7 +688,7 @@ sntp_getserver(u8_t idx) if (idx < SNTP_MAX_SERVERS) { return &sntp_servers[idx].addr; } - return IP4_ADDR_ANY; + return IP_ADDR_ANY; } #if SNTP_SERVER_DNS diff --git a/src/core/dns.c b/src/core/dns.c index 65355be7..05870db0 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -329,7 +329,7 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver) if (dnsserver != NULL) { dns_servers[numdns] = (*dnsserver); } else { - dns_servers[numdns] = *IP4_ADDR_ANY; + dns_servers[numdns] = *IP_ADDR_ANY; } } } @@ -348,7 +348,7 @@ dns_getserver(u8_t numdns) if (numdns < DNS_MAX_SERVERS) { return &dns_servers[numdns]; } else { - return IP4_ADDR_ANY; + return IP_ADDR_ANY; } } diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 0e37eeb2..d9b50777 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -1145,12 +1145,12 @@ int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) { nsa = dns_getserver(0); ip_addr_set_ip4_u32(&nsb, ns1); if (ip_addr_cmp(nsa, &nsb)) { - dns_setserver(0, IP4_ADDR_ANY); + dns_setserver(0, IP_ADDR_ANY); } nsa = dns_getserver(1); ip_addr_set_ip4_u32(&nsb, ns2); if (ip_addr_cmp(nsa, &nsb)) { - dns_setserver(1, IP4_ADDR_ANY); + dns_setserver(1, IP_ADDR_ANY); } return 1; } diff --git a/src/netif/ppp/pppol2tp.c b/src/netif/ppp/pppol2tp.c index f6e0f3a1..90cf1082 100644 --- a/src/netif/ppp/pppol2tp.c +++ b/src/netif/ppp/pppol2tp.c @@ -307,7 +307,7 @@ static err_t pppol2tp_connect(ppp_pcb *ppp, void *ctx) { udp_bind(l2tp->udp, IP6_ADDR_ANY, 0); } else #endif /* LWIP_IPV6 */ - udp_bind(l2tp->udp, IP4_ADDR_ANY, 0); + udp_bind(l2tp->udp, IP_ADDR_ANY, 0); #if PPPOL2TP_AUTH_SUPPORT /* Generate random vector */