From 792224ead0fd3198b50fc6ff39f61b8d7608bb83 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Thu, 17 Nov 2016 08:48:55 +0100 Subject: [PATCH] Try to fix compile error with clang (found by Erik's Travis-CI) --- src/api/api_msg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/api_msg.c b/src/api/api_msg.c index e19a6a0c..3971bd63 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -545,12 +545,14 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err) static void pcb_new(struct api_msg *msg) { - enum lwip_ip_addr_type iptype; + enum lwip_ip_addr_type iptype = IPADDR_TYPE_V4; LWIP_ASSERT("pcb_new: pcb already allocated", msg->conn->pcb.tcp == NULL); /* IPv6: Dual-stack by default, unless netconn_set_ipv6only() is called */ - iptype = NETCONNTYPE_ISIPV6(netconn_type(msg->conn))? IPADDR_TYPE_ANY : IPADDR_TYPE_V4; + if(NETCONNTYPE_ISIPV6(netconn_type(msg->conn))) { + iptype = IPADDR_TYPE_ANY; + } /* Allocate a PCB for this connection */ switch(NETCONNTYPE_GROUP(msg->conn->type)) {