aboutsummaryrefslogtreecommitdiff
path: root/src/exit/gnunet-daemon-exit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-10-26 22:13:01 +0000
committerChristian Grothoff <christian@grothoff.org>2012-10-26 22:13:01 +0000
commit64d3e46cfb99a711e500fa1f114e7c44bdf10040 (patch)
tree83093d92761d5c1b8b2fded713adaa19af29274c /src/exit/gnunet-daemon-exit.c
parentef6f05f63769263a5201636c4b7f71eaa455cdf3 (diff)
-bugfixes, code cleanup
Diffstat (limited to 'src/exit/gnunet-daemon-exit.c')
-rw-r--r--src/exit/gnunet-daemon-exit.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index 4359db33cc..a8c8d8922d 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -2964,31 +2964,6 @@ read_service_conf (void *cls GNUNET_UNUSED, const char *section)
/**
- * Test if the given AF is supported by this system.
- *
- * @param af to test
- * @return GNUNET_OK if the AF is supported
- */
-static int
-test_af (int af)
-{
- int s;
-
- s = socket (af, SOCK_STREAM, 0);
- if (-1 == s)
- {
- if (EAFNOSUPPORT == errno)
- return GNUNET_NO;
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
- "socket");
- return GNUNET_SYSERR;
- }
- close (s);
- return GNUNET_OK;
-}
-
-
-/**
* @brief Main function that will be run by the scheduler.
*
* @param cls closure
@@ -3042,7 +3017,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
ipv6_enabled = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "ENABLE_IPV6");
if ( (ipv4_exit || ipv4_enabled) &&
- GNUNET_OK != test_af (AF_INET))
+ GNUNET_OK != GNUNET_NETWORK_test_pf (PF_INET))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("This system does not support IPv4, will disable IPv4 functions despite them being enabled in the configuration\n"));
@@ -3050,7 +3025,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
ipv4_enabled = GNUNET_NO;
}
if ( (ipv6_exit || ipv6_enabled) &&
- GNUNET_OK != test_af (AF_INET6))
+ GNUNET_OK != GNUNET_NETWORK_test_pf (PF_INET6))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("This system does not support IPv6, will disable IPv6 functions despite them being enabled in the configuration\n"));