diff options
Diffstat (limited to 'src/exit/gnunet-daemon-exit.c')
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 0b3cc505a..5cb1ebfd9 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -458,13 +458,11 @@ GNUNET_NETWORK_STRUCT_END | |||
458 | * succeeded. | 458 | * succeeded. |
459 | * | 459 | * |
460 | * @param cls NULL | 460 | * @param cls NULL |
461 | * @param rs the socket that received the response | ||
462 | * @param dns the response itself | 461 | * @param dns the response itself |
463 | * @param r number of bytes in @a dns | 462 | * @param r number of bytes in @a dns |
464 | */ | 463 | */ |
465 | static void | 464 | static void |
466 | process_dns_result (void *cls, | 465 | process_dns_result (void *cls, |
467 | struct GNUNET_DNSSTUB_RequestSocket *rs, | ||
468 | const struct GNUNET_TUN_DnsHeader *dns, | 466 | const struct GNUNET_TUN_DnsHeader *dns, |
469 | size_t r) | 467 | size_t r) |
470 | { | 468 | { |
@@ -479,8 +477,7 @@ process_dns_result (void *cls, | |||
479 | return; | 477 | return; |
480 | /* Handle case that this is a reply to a request from a CADET DNS channel */ | 478 | /* Handle case that this is a reply to a request from a CADET DNS channel */ |
481 | ts = channels[dns->id]; | 479 | ts = channels[dns->id]; |
482 | if ( (NULL == ts) || | 480 | if (NULL == ts) |
483 | (ts->specifics.dns.rs != rs) ) | ||
484 | return; | 481 | return; |
485 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 482 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
486 | "Got a response from the stub resolver for DNS request received via CADET!\n"); | 483 | "Got a response from the stub resolver for DNS request received via CADET!\n"); |
@@ -557,11 +554,11 @@ handle_dns_request (void *cls, | |||
557 | dlen); | 554 | dlen); |
558 | dout = (struct GNUNET_TUN_DnsHeader *) buf; | 555 | dout = (struct GNUNET_TUN_DnsHeader *) buf; |
559 | dout->id = ts->specifics.dns.my_id; | 556 | dout->id = ts->specifics.dns.my_id; |
560 | ts->specifics.dns.rs = GNUNET_DNSSTUB_resolve2 (dnsstub, | 557 | ts->specifics.dns.rs = GNUNET_DNSSTUB_resolve (dnsstub, |
561 | buf, | 558 | buf, |
562 | dlen, | 559 | dlen, |
563 | &process_dns_result, | 560 | &process_dns_result, |
564 | NULL); | 561 | NULL); |
565 | if (NULL == ts->specifics.dns.rs) | 562 | if (NULL == ts->specifics.dns.rs) |
566 | { | 563 | { |
567 | GNUNET_break_op (0); | 564 | GNUNET_break_op (0); |
@@ -3545,25 +3542,23 @@ advertise_dns_exit () | |||
3545 | }; | 3542 | }; |
3546 | char *dns_exit; | 3543 | char *dns_exit; |
3547 | struct GNUNET_HashCode port; | 3544 | struct GNUNET_HashCode port; |
3548 | struct in_addr dns_exit4; | ||
3549 | struct in6_addr dns_exit6; | ||
3550 | 3545 | ||
3551 | if (GNUNET_YES != | 3546 | if (GNUNET_YES != |
3552 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 3547 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
3553 | "exit", | 3548 | "exit", |
3554 | "EXIT_DNS")) | 3549 | "EXIT_DNS")) |
3555 | return; | 3550 | return; |
3551 | GNUNET_assert (NULL != (dnsstub = GNUNET_DNSSTUB_start (128))); | ||
3552 | dns_exit = NULL; | ||
3553 | /* TODO: support using multiple DNS resolvers */ | ||
3556 | if ( (GNUNET_OK != | 3554 | if ( (GNUNET_OK != |
3557 | GNUNET_CONFIGURATION_get_value_string (cfg, | 3555 | GNUNET_CONFIGURATION_get_value_string (cfg, |
3558 | "exit", | 3556 | "exit", |
3559 | "DNS_RESOLVER", | 3557 | "DNS_RESOLVER", |
3560 | &dns_exit)) || | 3558 | &dns_exit)) || |
3561 | ( (1 != inet_pton (AF_INET, | 3559 | (GNUNET_OK != |
3562 | dns_exit, | 3560 | GNUNET_DNSSTUB_add_dns_ip (dnsstub, |
3563 | &dns_exit4)) && | 3561 | dns_exit)) ) |
3564 | (1 != inet_pton (AF_INET6, | ||
3565 | dns_exit, | ||
3566 | &dns_exit6)) ) ) | ||
3567 | { | 3562 | { |
3568 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, | 3563 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, |
3569 | "dns", | 3564 | "dns", |