summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2008-08-12 07:11:05 +0000
committerjsorg71 <jsorg71>2008-08-12 07:11:05 +0000
commitedf6d54b558b4879f3d67220ee7faa1ab93b2c12 (patch)
tree08febe2877a1d2cf88554339ace2b7d02c857e01
parentfa30584146ed1cee7f5ba110e0313cca1effdbf8 (diff)
downloadxrdp-proprietary-edf6d54b558b4879f3d67220ee7faa1ab93b2c12.tar.gz
xrdp-proprietary-edf6d54b558b4879f3d67220ee7faa1ab93b2c12.zip
added define check for ipv6 structs
-rw-r--r--sesman/libscp/libscp_session.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sesman/libscp/libscp_session.c b/sesman/libscp/libscp_session.c
index a7b3397c..6f86e208 100644
--- a/sesman/libscp/libscp_session.c
+++ b/sesman/libscp/libscp_session.c
@@ -259,7 +259,9 @@ int
scp_session_set_addr(struct SCP_SESSION* s, int type, void* addr)
{
struct in_addr ip4;
+#ifdef IN6ADDR_ANY_INIT
struct in6_addr ip6;
+#endif
int ret;
switch (type)
@@ -276,6 +278,10 @@ scp_session_set_addr(struct SCP_SESSION* s, int type, void* addr)
}
g_memcpy(&(s->ipv4addr), &(ip4.s_addr), 4);
break;
+ case SCP_ADDRESS_TYPE_IPV4_BIN:
+ g_memcpy(&(s->ipv4addr), addr, 4);
+ break;
+#ifdef IN6ADDR_ANY_INIT
case SCP_ADDRESS_TYPE_IPV6:
/* convert from char to 128bit*/
ret = inet_pton(AF_INET6, addr, &ip6);
@@ -288,12 +294,10 @@ scp_session_set_addr(struct SCP_SESSION* s, int type, void* addr)
}
g_memcpy(s->ipv6addr, &(ip6.s6_addr), 16);
break;
- case SCP_ADDRESS_TYPE_IPV4_BIN:
- g_memcpy(&(s->ipv4addr), addr, 4);
- break;
case SCP_ADDRESS_TYPE_IPV6_BIN:
g_memcpy(s->ipv6addr, addr, 16);
break;
+#endif
default:
return 1;
}