diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2013-06-21 03:16:10 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2013-06-21 03:16:10 +0000 |
commit | 0b5a2fefeaf0b06c5dbd1a1b39ed3ee1a562bb8b (patch) | |
tree | 5b4a73be9c14002c81e3044f5e8bdc1ecad34e97 /src/util/network.c | |
parent | 857d663744c0657f75d298e0f48e3bf444c07f42 (diff) | |
download | gnunet-0b5a2fefeaf0b06c5dbd1a1b39ed3ee1a562bb8b.tar.gz gnunet-0b5a2fefeaf0b06c5dbd1a1b39ed3ee1a562bb8b.zip |
Fix non-windows non-IPv6 build.
Diffstat (limited to 'src/util/network.c')
-rw-r--r-- | src/util/network.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/util/network.c b/src/util/network.c index ff0d0d03c..e730f097d 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -379,17 +379,23 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
379 | 379 | ||
380 | #ifdef IPV6_V6ONLY | 380 | #ifdef IPV6_V6ONLY |
381 | #ifdef IPPROTO_IPV6 | 381 | #ifdef IPPROTO_IPV6 |
382 | const int on = 1; | 382 | { |
383 | const int on = 1; | ||
383 | 384 | ||
384 | if (desc->af == AF_INET6) | 385 | if (desc->af == AF_INET6) |
385 | if (0 != setsockopt (desc->fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on))) | 386 | if (setsockopt (desc->fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on))) |
386 | LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "setsockopt"); | 387 | LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "setsockopt"); |
388 | } | ||
387 | #endif | 389 | #endif |
388 | #endif | 390 | #endif |
389 | #ifndef WINDOWS | 391 | #ifndef WINDOWS |
390 | /* This is required, and required here, but only on UNIX */ | 392 | { |
391 | if (0 != setsockopt (desc->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on))) | 393 | const int on = 1; |
392 | LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "setsockopt"); | 394 | |
395 | /* This is required, and required here, but only on UNIX */ | ||
396 | if (0 != setsockopt (desc->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on))) | ||
397 | LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "setsockopt"); | ||
398 | } | ||
393 | #endif | 399 | #endif |
394 | #ifndef LINUX | 400 | #ifndef LINUX |
395 | #ifndef MINGW | 401 | #ifndef MINGW |