ecore_con: restore ability for negative port on local connection.

Thanks make check.
This commit is contained in:
Cedric BAIL 2018-01-25 09:40:20 -08:00
parent 3f8c282544
commit fb3e49d66d
1 changed files with 7 additions and 4 deletions

View File

@ -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);