summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_socket.c
diff options
context:
space:
mode:
authorS. Hameed <shameed@jp.adit-jv.com>2015-11-27 18:16:59 +0900
committerLutz Helwing <lutz_helwing@mentor.com>2015-12-07 10:07:26 +0100
commitf817bdaf8b45c8fb11280b572565475eeee5ed73 (patch)
tree3cf16c8eab07370ea57b2a1438ff6335f6988794 /src/daemon/dlt_daemon_socket.c
parent979364a42e12b1bb473a5bcc1554ef0b2ce80fde (diff)
downloadDLT-daemon-f817bdaf8b45c8fb11280b572565475eeee5ed73.tar.gz
dlt-daemon: Make IP version compile time configurable
Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
Diffstat (limited to 'src/daemon/dlt_daemon_socket.c')
-rw-r--r--src/daemon/dlt_daemon_socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/daemon/dlt_daemon_socket.c b/src/daemon/dlt_daemon_socket.c
index 1054e9a..686f4d6 100644
--- a/src/daemon/dlt_daemon_socket.c
+++ b/src/daemon/dlt_daemon_socket.c
@@ -71,7 +71,11 @@ int dlt_daemon_socket_open(int *sock, unsigned int servPort)
int rv;
memset(&hints, 0, sizeof hints);
+#ifdef DLT_USE_IPv6
hints.ai_family = AF_INET6; // force IPv6 - will still work with IPv4
+#else
+ hints.ai_family = AF_INET;
+#endif
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE; // use my IP address