From fb3e49d66d033d13d007558cc51bf5f95c068cb1 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 25 Jan 2018 09:40:20 -0800 Subject: [PATCH] ecore_con: restore ability for negative port on local connection. Thanks make check. --- src/lib/ecore_con/ecore_con_legacy.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c index 481ecd0a5c..db0db5169e 100644 --- a/src/lib/ecore_con/ecore_con_legacy.c +++ b/src/lib/ecore_con/ecore_con_legacy.c @@ -1671,15 +1671,18 @@ ecore_con_server_add(Ecore_Con_Type compl_type, Eo *loop; EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); - /* The allowable port number is an unsigned 16-bit integer, so 1-65535, 0 is reserved */ - if ((port < 0) || (port > 65535)) + + type = compl_type & ECORE_CON_TYPE; + + /* The allowable port number is an unsigned 16-bit integer for remote connection, so 1-65535, 0 is reserved */ + if (((type == ECORE_CON_REMOTE_TCP) || (type == ECORE_CON_REMOTE_NODELAY) || (type == ECORE_CON_REMOTE_CORK) || + (type == ECORE_CON_REMOTE_UDP) || (type == ECORE_CON_REMOTE_MCAST)) && + (port < 0) || (port > 65535)) { ERR("Port %i invalid (0 <= port <= 65535)", port); return NULL; } - type = compl_type & ECORE_CON_TYPE; - loop = efl_main_loop_get(); EINA_SAFETY_ON_NULL_RETURN_VAL(loop, NULL);