diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-11-29 22:11:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-11-29 22:11:44 +0000 |
commit | 0942d0e8b1f95d69f550aac7b8abe5e64b2fb6b8 (patch) | |
tree | 58658f9e0e28e5225e40cdea8d5533850fa7c7ca /src/transport/plugin_transport_udp.c | |
parent | 31c05b833f0d6e87c8626a002f5a2060e4222f56 (diff) | |
download | gnunet-0942d0e8b1f95d69f550aac7b8abe5e64b2fb6b8.tar.gz gnunet-0942d0e8b1f95d69f550aac7b8abe5e64b2fb6b8.zip |
fixing bogus port bind by UDP
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 94447bdbc..4bf66f206 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include "gnunet_protocols.h" | 46 | #include "gnunet_protocols.h" |
47 | #include "gnunet_resolver_service.h" | 47 | #include "gnunet_resolver_service.h" |
48 | #include "gnunet_server_lib.h" | 48 | #include "gnunet_server_lib.h" |
49 | #include "gnunet_service_lib.h" | ||
50 | #include "gnunet_signatures.h" | 49 | #include "gnunet_signatures.h" |
51 | #include "gnunet_statistics_service.h" | 50 | #include "gnunet_statistics_service.h" |
52 | #include "gnunet_transport_service.h" | 51 | #include "gnunet_transport_service.h" |
@@ -355,11 +354,6 @@ struct Plugin | |||
355 | */ | 354 | */ |
356 | struct GNUNET_TRANSPORT_PluginEnvironment *env; | 355 | struct GNUNET_TRANSPORT_PluginEnvironment *env; |
357 | 356 | ||
358 | /** | ||
359 | * Handle to the network service. | ||
360 | */ | ||
361 | struct GNUNET_SERVICE_Context *service; | ||
362 | |||
363 | /* | 357 | /* |
364 | * Session of peers with whom we are currently connected | 358 | * Session of peers with whom we are currently connected |
365 | */ | 359 | */ |
@@ -2152,7 +2146,6 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2152 | unsigned long long port; | 2146 | unsigned long long port; |
2153 | struct GNUNET_TRANSPORT_PluginFunctions *api; | 2147 | struct GNUNET_TRANSPORT_PluginFunctions *api; |
2154 | struct Plugin *plugin; | 2148 | struct Plugin *plugin; |
2155 | struct GNUNET_SERVICE_Context *service; | ||
2156 | int sockets_created; | 2149 | int sockets_created; |
2157 | int behind_nat; | 2150 | int behind_nat; |
2158 | int allow_nat; | 2151 | int allow_nat; |
@@ -2161,15 +2154,6 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2161 | char *external_address; | 2154 | char *external_address; |
2162 | struct IPv4UdpAddress v4_address; | 2155 | struct IPv4UdpAddress v4_address; |
2163 | 2156 | ||
2164 | service = GNUNET_SERVICE_start ("transport-udp", env->cfg); | ||
2165 | if (service == NULL) | ||
2166 | { | ||
2167 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _ | ||
2168 | ("Failed to start service for `%s' transport plugin.\n"), | ||
2169 | "udp"); | ||
2170 | return NULL; | ||
2171 | } | ||
2172 | |||
2173 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (env->cfg, | 2157 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (env->cfg, |
2174 | "transport-udp", | 2158 | "transport-udp", |
2175 | "BEHIND_NAT")) | 2159 | "BEHIND_NAT")) |
@@ -2219,7 +2203,6 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2219 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2203 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2220 | _("Require EXTERNAL_ADDRESS for service `%s' in configuration (either BEHIND_NAT or ALLOW_NAT set to YES)!\n"), | 2204 | _("Require EXTERNAL_ADDRESS for service `%s' in configuration (either BEHIND_NAT or ALLOW_NAT set to YES)!\n"), |
2221 | "transport-udp"); | 2205 | "transport-udp"); |
2222 | GNUNET_SERVICE_stop (service); | ||
2223 | return NULL; | 2206 | return NULL; |
2224 | } | 2207 | } |
2225 | 2208 | ||
@@ -2238,7 +2221,6 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2238 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2221 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2239 | _("Require INTERNAL_ADDRESS for service `%s' in configuration!\n"), | 2222 | _("Require INTERNAL_ADDRESS for service `%s' in configuration!\n"), |
2240 | "transport-udp"); | 2223 | "transport-udp"); |
2241 | GNUNET_SERVICE_stop (service); | ||
2242 | GNUNET_free_non_null(external_address); | 2224 | GNUNET_free_non_null(external_address); |
2243 | return NULL; | 2225 | return NULL; |
2244 | } | 2226 | } |
@@ -2261,7 +2243,6 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2261 | "PORT", | 2243 | "PORT", |
2262 | port, | 2244 | port, |
2263 | 65535); | 2245 | 65535); |
2264 | GNUNET_SERVICE_stop (service); | ||
2265 | GNUNET_free_non_null(external_address); | 2246 | GNUNET_free_non_null(external_address); |
2266 | GNUNET_free_non_null(internal_address); | 2247 | GNUNET_free_non_null(internal_address); |
2267 | return NULL; | 2248 | return NULL; |
@@ -2291,8 +2272,6 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2291 | api->address_to_string = &udp_address_to_string; | 2272 | api->address_to_string = &udp_address_to_string; |
2292 | api->check_address = &udp_check_address; | 2273 | api->check_address = &udp_check_address; |
2293 | 2274 | ||
2294 | plugin->service = service; | ||
2295 | |||
2296 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_string(env->cfg, "transport-udp", "BINDTO", &plugin->bind_address)) | 2275 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_string(env->cfg, "transport-udp", "BINDTO", &plugin->bind_address)) |
2297 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Binding udp plugin to specific address: `%s'\n", plugin->bind_address); | 2276 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Binding udp plugin to specific address: `%s'\n", plugin->bind_address); |
2298 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_string(env->cfg, "transport-udp", "BINDTO6", &plugin->bind6_address)) | 2277 | if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_string(env->cfg, "transport-udp", "BINDTO6", &plugin->bind6_address)) |
@@ -2348,8 +2327,6 @@ libgnunet_plugin_transport_udp_done (void *cls) | |||
2348 | plugin->hostname_dns = NULL; | 2327 | plugin->hostname_dns = NULL; |
2349 | } | 2328 | } |
2350 | 2329 | ||
2351 | GNUNET_SERVICE_stop (plugin->service); | ||
2352 | |||
2353 | GNUNET_NETWORK_fdset_destroy (plugin->rs); | 2330 | GNUNET_NETWORK_fdset_destroy (plugin->rs); |
2354 | while (NULL != (lal = plugin->lal_head)) | 2331 | while (NULL != (lal = plugin->lal_head)) |
2355 | { | 2332 | { |