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/vpn | |
parent | ef6f05f63769263a5201636c4b7f71eaa455cdf3 (diff) | |
download | gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.tar.gz gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.zip |
-bugfixes, code cleanup
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 5a52a6cda..abdc16d79 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -3003,31 +3003,6 @@ client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
3003 | 3003 | ||
3004 | 3004 | ||
3005 | /** | 3005 | /** |
3006 | * Test if the given AF is supported by this system. | ||
3007 | * | ||
3008 | * @param af to test | ||
3009 | * @return GNUNET_OK if the AF is supported | ||
3010 | */ | ||
3011 | static int | ||
3012 | test_af (int af) | ||
3013 | { | ||
3014 | int s; | ||
3015 | |||
3016 | s = socket (af, SOCK_STREAM, 0); | ||
3017 | if (-1 == s) | ||
3018 | { | ||
3019 | if (EAFNOSUPPORT == errno) | ||
3020 | return GNUNET_NO; | ||
3021 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, | ||
3022 | "socket"); | ||
3023 | return GNUNET_SYSERR; | ||
3024 | } | ||
3025 | (void) close (s); | ||
3026 | return GNUNET_OK; | ||
3027 | } | ||
3028 | |||
3029 | |||
3030 | /** | ||
3031 | * Main function that will be run by the scheduler. | 3006 | * Main function that will be run by the scheduler. |
3032 | * | 3007 | * |
3033 | * @param cls closure | 3008 | * @param cls closure |
@@ -3100,7 +3075,7 @@ run (void *cls, | |||
3100 | return; | 3075 | return; |
3101 | } | 3076 | } |
3102 | vpn_argv[1] = ifname; | 3077 | vpn_argv[1] = ifname; |
3103 | if (GNUNET_OK == test_af (AF_INET6)) | 3078 | if (GNUNET_OK == GNUNET_NETWORK_test_pf (PF_INET6)) |
3104 | { | 3079 | { |
3105 | if ( (GNUNET_SYSERR == | 3080 | if ( (GNUNET_SYSERR == |
3106 | GNUNET_CONFIGURATION_get_value_string (cfg, "vpn", "IPV6ADDR", | 3081 | GNUNET_CONFIGURATION_get_value_string (cfg, "vpn", "IPV6ADDR", |
@@ -3140,7 +3115,7 @@ run (void *cls, | |||
3140 | vpn_argv[2] = GNUNET_strdup ("-"); | 3115 | vpn_argv[2] = GNUNET_strdup ("-"); |
3141 | vpn_argv[3] = GNUNET_strdup ("-"); | 3116 | vpn_argv[3] = GNUNET_strdup ("-"); |
3142 | } | 3117 | } |
3143 | if (GNUNET_OK == test_af (AF_INET)) | 3118 | if (GNUNET_OK == GNUNET_NETWORK_test_pf (PF_INET)) |
3144 | { | 3119 | { |
3145 | if ( (GNUNET_SYSERR == | 3120 | if ( (GNUNET_SYSERR == |
3146 | GNUNET_CONFIGURATION_get_value_string (cfg, "vpn", "IPV4ADDR", | 3121 | GNUNET_CONFIGURATION_get_value_string (cfg, "vpn", "IPV4ADDR", |