mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-06 00:39:59 +00:00
Fix compile when IPv4 is disabled
This commit is contained in:
parent
a6bc422729
commit
1687721600
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user