diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-26 22:13:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-26 22:13:01 +0000 |
commit | 64d3e46cfb99a711e500fa1f114e7c44bdf10040 (patch) | |
tree | 83093d92761d5c1b8b2fded713adaa19af29274c /src/exit | |
parent | ef6f05f63769263a5201636c4b7f71eaa455cdf3 (diff) | |
download | gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.tar.gz gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.zip |
-bugfixes, code cleanup
Diffstat (limited to 'src/exit')
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 4359db33c..a8c8d8922 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) | |||
2964 | 2964 | ||
2965 | 2965 | ||
2966 | /** | 2966 | /** |
2967 | * Test if the given AF is supported by this system. | ||
2968 | * | ||
2969 | * @param af to test | ||
2970 | * @return GNUNET_OK if the AF is supported | ||
2971 | */ | ||
2972 | static int | ||
2973 | test_af (int af) | ||
2974 | { | ||
2975 | int s; | ||
2976 | |||
2977 | s = socket (af, SOCK_STREAM, 0); | ||
2978 | if (-1 == s) | ||
2979 | { | ||
2980 | if (EAFNOSUPPORT == errno) | ||
2981 | return GNUNET_NO; | ||
2982 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, | ||
2983 | "socket"); | ||
2984 | return GNUNET_SYSERR; | ||
2985 | } | ||
2986 | close (s); | ||
2987 | return GNUNET_OK; | ||
2988 | } | ||
2989 | |||
2990 | |||
2991 | /** | ||
2992 | * @brief Main function that will be run by the scheduler. | 2967 | * @brief Main function that will be run by the scheduler. |
2993 | * | 2968 | * |
2994 | * @param cls closure | 2969 | * @param cls closure |
@@ -3042,7 +3017,7 @@ run (void *cls, char *const *args GNUNET_UNUSED, | |||
3042 | ipv6_enabled = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "ENABLE_IPV6"); | 3017 | ipv6_enabled = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "ENABLE_IPV6"); |
3043 | 3018 | ||
3044 | if ( (ipv4_exit || ipv4_enabled) && | 3019 | if ( (ipv4_exit || ipv4_enabled) && |
3045 | GNUNET_OK != test_af (AF_INET)) | 3020 | GNUNET_OK != GNUNET_NETWORK_test_pf (PF_INET)) |
3046 | { | 3021 | { |
3047 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 3022 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
3048 | _("This system does not support IPv4, will disable IPv4 functions despite them being enabled in the configuration\n")); | 3023 | _("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, | |||
3050 | ipv4_enabled = GNUNET_NO; | 3025 | ipv4_enabled = GNUNET_NO; |
3051 | } | 3026 | } |
3052 | if ( (ipv6_exit || ipv6_enabled) && | 3027 | if ( (ipv6_exit || ipv6_enabled) && |
3053 | GNUNET_OK != test_af (AF_INET6)) | 3028 | GNUNET_OK != GNUNET_NETWORK_test_pf (PF_INET6)) |
3054 | { | 3029 | { |
3055 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 3030 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
3056 | _("This system does not support IPv6, will disable IPv6 functions despite them being enabled in the configuration\n")); | 3031 | _("This system does not support IPv6, will disable IPv6 functions despite them being enabled in the configuration\n")); |