aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-05-14 18:19:57 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-14 18:41:48 +0200
commit9c571f01f7af8db1df238daa3136bf639247ac55 (patch)
tree47239ac644be863c2267f8ee16b2900b41a5c646 /src/lib/ecore_con
parenteina: add crosss platforme API to retrieve tmp and home directories from envi... (diff)
downloadefl-9c571f01f7af8db1df238daa3136bf639247ac55.tar.gz
ecore_con: it doesn't make sense to get port on local protocol.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index 3e6ad7af54..dee26e1729 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -955,6 +955,15 @@ ecore_con_client_ip_get(const Ecore_Con *obj)
EOLIAN static int
_ecore_con_client_ecore_con_base_port_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl)
{
+ Ecore_Con_Server_Data *sd = eo_data_scope_get(cl->host_server, ECORE_CON_SERVER_CLASS);
+
+ if (sd->type != ECORE_CON_REMOTE_TCP &&
+ sd->type != ECORE_CON_REMOTE_MCAST &&
+ sd->type != ECORE_CON_REMOTE_UDP &&
+ sd->type != ECORE_CON_REMOTE_BROADCAST &&
+ sd->type != ECORE_CON_REMOTE_NODELAY)
+ return -1;
+
if (cl->client_addr->sa_family == AF_INET)
return ((struct sockaddr_in *)cl->client_addr)->sin_port;
#ifdef HAVE_IPV6