diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-09 11:18:12 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-09 11:18:12 +0000 |
commit | c42552705ccf37473a17f20dd0078f5a79ca5e4e (patch) | |
tree | 01224badaa26397277c2fd5057cef7013f9f697b /src/transport/plugin_transport_udp.c | |
parent | 1b8c23237739fce9ccbaec3467bbe369605202c7 (diff) | |
download | gnunet-c42552705ccf37473a17f20dd0078f5a79ca5e4e.tar.gz gnunet-c42552705ccf37473a17f20dd0078f5a79ca5e4e.zip |
malformed address handling
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index deb8f3ad4..0eddcfe26 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -903,6 +903,7 @@ udp_plugin_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc | |||
903 | struct UDP_NAT_Probes *temp_probe; | 903 | struct UDP_NAT_Probes *temp_probe; |
904 | int port; | 904 | int port; |
905 | char *port_start; | 905 | char *port_start; |
906 | struct sockaddr_in in_addr; | ||
906 | 907 | ||
907 | if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) | 908 | if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) |
908 | return; | 909 | return; |
@@ -951,6 +952,19 @@ udp_plugin_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc | |||
951 | /** We have received an ICMP response, ostensibly from a non-NAT'd peer | 952 | /** We have received an ICMP response, ostensibly from a non-NAT'd peer |
952 | * that wants to connect to us! Send a message to establish a connection. | 953 | * that wants to connect to us! Send a message to establish a connection. |
953 | */ | 954 | */ |
955 | if (inet_pton(AF_INET, &mybuf[0], &in_addr.sin_addr) != 1) | ||
956 | { | ||
957 | |||
958 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "udp", | ||
959 | _("nat-server-read malformed address\n"), &mybuf, port); | ||
960 | |||
961 | plugin->server_read_task = | ||
962 | GNUNET_SCHEDULER_add_read_file (plugin->env->sched, | ||
963 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
964 | plugin->server_stdout_handle, &udp_plugin_server_read, plugin); | ||
965 | return; | ||
966 | } | ||
967 | |||
954 | temp_probe = find_probe(plugin, &mybuf[0]); | 968 | temp_probe = find_probe(plugin, &mybuf[0]); |
955 | 969 | ||
956 | if (temp_probe == NULL) | 970 | if (temp_probe == NULL) |