]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Fix bug #36857: tcp_listen_dual_with_backlog() only works with ANY
authorJames Smith <jsmith@ecoscentric.com>
Tue, 24 Jul 2012 16:34:09 +0000 (10:34 -0600)
committerIvan Delamer <delamer@inicotech.com>
Tue, 24 Jul 2012 16:34:09 +0000 (10:34 -0600)
address

Change-Id: I092a4c9978d88040214fc44a4c4b353be618d76c

src/core/tcp.c

index 05e7c7d858aadd220cc618bf3858a29f49905fbf..a0cbb15958c357b3be005269d7805efccc9c8895 100644 (file)
@@ -591,11 +591,12 @@ tcp_listen_dual_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
 {
   struct tcp_pcb *lpcb;
 
-  if (!ipX_addr_isany(PCB_ISIPV6(pcb), &pcb->local_ip)) {
-    return NULL;
-  }
   lpcb = tcp_listen_with_backlog(pcb, backlog);
-  if (lpcb != NULL) {
+  if ((lpcb != NULL) &&
+      ipX_addr_isany(PCB_ISIPV6(pcb), &pcb->local_ip)) {
+    /* The default behavior is to accept connections on either
+     * IPv4 or IPv6, if not bound. */
+    /* @see NETCONN_FLAG_IPV6_V6ONLY for changing this behavior */
     ((struct tcp_pcb_listen*)lpcb)->accept_any_ip_version = 1;
   }
   return lpcb;