correct version of --> Allow "" and NULL on TCP host and service (=> IP=INADDR_ANY, and port=0)
authorMario de Sousa <msousa@fe.up.pt>
Mon, 01 Jun 2020 14:27:56 +0100
changeset 10 1aed7a582ca7
parent 9 d6effe86bc2f
child 11 7c955a1d39e8
correct version of --> Allow "" and NULL on TCP host and service (=> IP=INADDR_ANY, and port=0)
mb_tcp.c
--- a/mb_tcp.c	Mon Jun 01 14:24:57 2020 +0100
+++ b/mb_tcp.c	Mon Jun 01 14:27:56 2020 +0100
@@ -1517,8 +1517,8 @@
 
   /* Check the parameters we were passed... */
   if(sin_initaddr(&tmp_addr,
-                  node_addr.addr.tcp.host,    0,
-                  node_addr.addr.tcp.service, 0,
+                  node_addr.addr.tcp.host,    1, // 1 => allow host NULL, "" or "*" -> INADDR_ANY
+                  node_addr.addr.tcp.service, 1, // 1 => allow serivce NULL or ""   -> port = 0                  
                   DEF_PROTOCOL)
        < 0) {
 #ifdef ERRMSG