diff options
author | Bruno Cabral <bcabral@uw.edu> | 2015-08-17 01:59:44 +0000 |
---|---|---|
committer | Bruno Cabral <bcabral@uw.edu> | 2015-08-17 01:59:44 +0000 |
commit | 40e5419b8db86bfb9a0bb5eba083e9a97e9dd9e9 (patch) | |
tree | e97611f11f899bf6471ce05b9a0aab0948b8e99c /src/nat/nat_stun.c | |
parent | 8ac76aa1354d40a55942ebabb8a2b59a558e427a (diff) | |
download | gnunet-40e5419b8db86bfb9a0bb5eba083e9a97e9dd9e9.tar.gz gnunet-40e5419b8db86bfb9a0bb5eba083e9a97e9dd9e9.zip |
Fix #3918
Diffstat (limited to 'src/nat/nat_stun.c')
-rw-r--r-- | src/nat/nat_stun.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nat/nat_stun.c b/src/nat/nat_stun.c index 5e502c29e..5fff40656 100644 --- a/src/nat/nat_stun.c +++ b/src/nat/nat_stun.c | |||
@@ -334,7 +334,7 @@ stun_get_mapped(struct StunState *st, struct stun_attr *attr,struct sockaddr_in | |||
334 | * @return, GNUNET_OK on OK, GNUNET_NO if the packet is invalid ( not a stun packet) | 334 | * @return, GNUNET_OK on OK, GNUNET_NO if the packet is invalid ( not a stun packet) |
335 | */ | 335 | */ |
336 | int | 336 | int |
337 | GNUNET_NAT_stun_handle_packet(const uint8_t *data, size_t len,struct sockaddr_in *arg) | 337 | GNUNET_NAT_stun_handle_packet(const void *data, size_t len, struct sockaddr_in *arg) |
338 | { | 338 | { |
339 | struct stun_header *hdr = (struct stun_header *)data; | 339 | struct stun_header *hdr = (struct stun_header *)data; |
340 | struct stun_attr *attr; | 340 | struct stun_attr *attr; |
@@ -463,8 +463,9 @@ stun_dns_callback (void *cls, | |||
463 | 463 | ||
464 | if( GNUNET_NO == request->dns_success){ | 464 | if( GNUNET_NO == request->dns_success){ |
465 | LOG (GNUNET_ERROR_TYPE_INFO, "Empty request\n"); | 465 | LOG (GNUNET_ERROR_TYPE_INFO, "Empty request\n"); |
466 | clean(request); | ||
467 | request->cb(request->cb_cls, GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR); | 466 | request->cb(request->cb_cls, GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR); |
467 | clean(request); | ||
468 | |||
468 | } | 469 | } |
469 | return; | 470 | return; |
470 | } | 471 | } |
@@ -474,8 +475,9 @@ stun_dns_callback (void *cls, | |||
474 | 475 | ||
475 | if( GNUNET_NO == request->dns_success){ | 476 | if( GNUNET_NO == request->dns_success){ |
476 | LOG (GNUNET_ERROR_TYPE_INFO, "Error resolving host %s\n", request->stun_server); | 477 | LOG (GNUNET_ERROR_TYPE_INFO, "Error resolving host %s\n", request->stun_server); |
477 | clean(request); | ||
478 | request->cb(request->cb_cls, GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR); | 478 | request->cb(request->cb_cls, GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR); |
479 | clean(request); | ||
480 | |||
479 | } | 481 | } |
480 | 482 | ||
481 | return; | 483 | return; |
@@ -503,8 +505,8 @@ stun_dns_callback (void *cls, | |||
503 | (const struct sockaddr *) &server, sizeof (server))) | 505 | (const struct sockaddr *) &server, sizeof (server))) |
504 | { | 506 | { |
505 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "Fail to sendto"); | 507 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "Fail to sendto"); |
506 | clean(request); | ||
507 | request->cb(request->cb_cls, GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR); | 508 | request->cb(request->cb_cls, GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR); |
509 | clean(request); | ||
508 | return; | 510 | return; |
509 | } | 511 | } |
510 | 512 | ||