diff options
author | Bart Polot <bart@net.in.tum.de> | 2015-10-06 19:09:30 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2015-10-06 19:09:30 +0000 |
commit | 88a70fd6af0e132f2a13bc682f4c10f3d4971198 (patch) | |
tree | 4cbc86459cfd3bafcc09c7b627028e9ba3218ff4 /src/nat/test_stun.c | |
parent | 74735f9ef6d47283feb58d8b5ca7209875150063 (diff) | |
download | gnunet-88a70fd6af0e132f2a13bc682f4c10f3d4971198.tar.gz gnunet-88a70fd6af0e132f2a13bc682f4c10f3d4971198.zip |
- fix multiple gnunet-nat crashes
Diffstat (limited to 'src/nat/test_stun.c')
-rw-r--r-- | src/nat/test_stun.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nat/test_stun.c b/src/nat/test_stun.c index edb7a89eb..5045b1cac 100644 --- a/src/nat/test_stun.c +++ b/src/nat/test_stun.c | |||
@@ -105,7 +105,7 @@ stop () | |||
105 | * Activity on our incoming socket. Read data from the | 105 | * Activity on our incoming socket. Read data from the |
106 | * incoming connection. | 106 | * incoming connection. |
107 | * | 107 | * |
108 | * @param cls | 108 | * @param cls |
109 | * @param tc scheduler context | 109 | * @param tc scheduler context |
110 | */ | 110 | */ |
111 | static void | 111 | static void |
@@ -123,7 +123,7 @@ do_udp_read (void *cls, | |||
123 | { | 123 | { |
124 | rlen = GNUNET_NETWORK_socket_recv (lsock4, reply_buf, sizeof (reply_buf)); | 124 | rlen = GNUNET_NETWORK_socket_recv (lsock4, reply_buf, sizeof (reply_buf)); |
125 | 125 | ||
126 | 126 | ||
127 | //Lets handle the packet | 127 | //Lets handle the packet |
128 | memset(&answer, 0, sizeof(struct sockaddr_in)); | 128 | memset(&answer, 0, sizeof(struct sockaddr_in)); |
129 | 129 | ||
@@ -154,8 +154,6 @@ do_udp_read (void *cls, | |||
154 | } | 154 | } |
155 | 155 | ||
156 | ltask4 = NULL; | 156 | ltask4 = NULL; |
157 | |||
158 | |||
159 | } | 157 | } |
160 | 158 | ||
161 | 159 | ||
@@ -176,7 +174,7 @@ bind_v4 () | |||
176 | sa4.sin_port = htons (port); | 174 | sa4.sin_port = htons (port); |
177 | #if HAVE_SOCKADDR_IN_SIN_LEN | 175 | #if HAVE_SOCKADDR_IN_SIN_LEN |
178 | sa4.sin_len = sizeof (sa4); | 176 | sa4.sin_len = sizeof (sa4); |
179 | #endif | 177 | #endif |
180 | ls = GNUNET_NETWORK_socket_create (AF_INET, | 178 | ls = GNUNET_NETWORK_socket_create (AF_INET, |
181 | SOCK_DGRAM, | 179 | SOCK_DGRAM, |
182 | 0); | 180 | 0); |
@@ -243,7 +241,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
243 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 241 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
244 | "Service listens on port %u\n", | 242 | "Service listens on port %u\n", |
245 | port); | 243 | port); |
246 | GNUNET_NAT_stun_make_request(stun_server, stun_port, lsock4, &request_callback, NULL); | 244 | GNUNET_NAT_stun_make_request (stun_server, stun_port, lsock4, |
245 | &request_callback, NULL); | ||
247 | 246 | ||
248 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &stop, NULL); | 247 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &stop, NULL); |
249 | 248 | ||