diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-07-20 14:48:47 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-07-20 14:48:47 +0000 |
commit | a40b39dd8a07f9c8ef080d643139d19e12267cfa (patch) | |
tree | a4df0284fbcdc8de95dac241f56abf47143d7949 /src/testing/testing.c | |
parent | 49b07dccadd47a8eab6add761bcf7e57726eb5fe (diff) | |
download | gnunet-a40b39dd8a07f9c8ef080d643139d19e12267cfa.tar.gz gnunet-a40b39dd8a07f9c8ef080d643139d19e12267cfa.zip |
decide btw ipv4 or ipv6
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r-- | src/testing/testing.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index 45aa0d30c..bba46231d 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -605,7 +605,8 @@ update_config (void *cls, const char *section, const char *option, | |||
605 | 605 | ||
606 | 606 | ||
607 | /** | 607 | /** |
608 | * Section iterator to set ACCEPT_FROM in all sections | 608 | * Section iterator to set ACCEPT_FROM/ACCEPT_FROM6 depending on the ip of the |
609 | * controller in all sections | ||
609 | * | 610 | * |
610 | * @param cls the UpdateContext | 611 | * @param cls the UpdateContext |
611 | * @param section name of the section | 612 | * @param section name of the section |
@@ -620,6 +621,7 @@ update_config_sections (void *cls, | |||
620 | char *ptr; | 621 | char *ptr; |
621 | char *orig_allowed_hosts; | 622 | char *orig_allowed_hosts; |
622 | char *allowed_hosts; | 623 | char *allowed_hosts; |
624 | char *ACCEPT_FROM_key; | ||
623 | uint16_t ikeys_cnt; | 625 | uint16_t ikeys_cnt; |
624 | uint16_t key; | 626 | uint16_t key; |
625 | 627 | ||
@@ -681,8 +683,12 @@ update_config_sections (void *cls, | |||
681 | GNUNET_free (ikeys); | 683 | GNUNET_free (ikeys); |
682 | } | 684 | } |
683 | GNUNET_free_non_null (val); | 685 | GNUNET_free_non_null (val); |
686 | ACCEPT_FROM_key = "ACCEPT_FROM"; | ||
687 | if ((NULL != uc->system->controller) && | ||
688 | (NULL != strstr (uc->system->controller, ":"))) /* IPv6 in use */ | ||
689 | ACCEPT_FROM_key = "ACCEPT_FROM6"; | ||
684 | if (GNUNET_OK != | 690 | if (GNUNET_OK != |
685 | GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, "ACCEPT_FROM", | 691 | GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, ACCEPT_FROM_key, |
686 | &orig_allowed_hosts)) | 692 | &orig_allowed_hosts)) |
687 | { | 693 | { |
688 | orig_allowed_hosts = GNUNET_strdup ("127.0.0.1;"); | 694 | orig_allowed_hosts = GNUNET_strdup ("127.0.0.1;"); |
@@ -693,7 +699,7 @@ update_config_sections (void *cls, | |||
693 | GNUNET_asprintf (&allowed_hosts, "%s%s;", orig_allowed_hosts, | 699 | GNUNET_asprintf (&allowed_hosts, "%s%s;", orig_allowed_hosts, |
694 | uc->system->controller); | 700 | uc->system->controller); |
695 | GNUNET_free (orig_allowed_hosts); | 701 | GNUNET_free (orig_allowed_hosts); |
696 | GNUNET_CONFIGURATION_set_value_string (uc->cfg, section, "ACCEPT_FROM", | 702 | GNUNET_CONFIGURATION_set_value_string (uc->cfg, section, ACCEPT_FROM_key, |
697 | allowed_hosts); | 703 | allowed_hosts); |
698 | GNUNET_free (allowed_hosts); | 704 | GNUNET_free (allowed_hosts); |
699 | } | 705 | } |