aboutsummaryrefslogtreecommitdiff
path: root/src/exit
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-12-19 13:26:59 +0000
committerBart Polot <bart@net.in.tum.de>2012-12-19 13:26:59 +0000
commit60c8164095399a95bc63493ccad6ff3630ee130c (patch)
treec71a42d817f13928433e32e01184a6de04158840 /src/exit
parentccc37ce1438490a519e33d97829277ba16221425 (diff)
downloadgnunet-60c8164095399a95bc63493ccad6ff3630ee130c.tar.gz
gnunet-60c8164095399a95bc63493ccad6ff3630ee130c.zip
- use prefix
Diffstat (limited to 'src/exit')
-rw-r--r--src/exit/gnunet-daemon-exit.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index aab25072a..5f60ea4cd 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -3015,6 +3015,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
3015 char *ipv4mask; 3015 char *ipv4mask;
3016 char *binary; 3016 char *binary;
3017 char *regex; 3017 char *regex;
3018 char *prefixed_regex;
3018 3019
3019 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit"); 3020 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit");
3020 if (GNUNET_YES != 3021 if (GNUNET_YES !=
@@ -3209,19 +3210,37 @@ run (void *cls, char *const *args GNUNET_UNUSED,
3209 if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) ) 3210 if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) )
3210 { 3211 {
3211 if (GNUNET_OK != 3212 if (GNUNET_OK !=
3212 GNUNET_CONFIGURATION_get_value_string (cfg, "exit", "EXIT_RANGE_IPV4_REGEX", &regex)) 3213 GNUNET_CONFIGURATION_get_value_string (cfg,
3214 "exit",
3215 "EXIT_RANGE_IPV4_REGEX",
3216 &regex))
3213 regex = GNUNET_strdup ("(0|1)*"); 3217 regex = GNUNET_strdup ("(0|1)*");
3214 GNUNET_MESH_announce_regex (mesh_handle, regex, REGEX_MAX_PATH_LEN_IPV4); 3218 (void) GNUNET_asprintf (&prefixed_regex, "%s%s%s",
3219 GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,
3220 "4", regex);
3221 GNUNET_MESH_announce_regex (mesh_handle,
3222 prefixed_regex,
3223 REGEX_MAX_PATH_LEN_IPV4);
3215 GNUNET_free (regex); 3224 GNUNET_free (regex);
3225 GNUNET_free (prefixed_regex);
3216 } 3226 }
3217 3227
3218 if (GNUNET_YES == ipv6_enabled && GNUNET_YES == ipv6_exit) 3228 if (GNUNET_YES == ipv6_enabled && GNUNET_YES == ipv6_exit)
3219 { 3229 {
3220 if (GNUNET_OK != 3230 if (GNUNET_OK !=
3221 GNUNET_CONFIGURATION_get_value_string (cfg, "exit", "EXIT_RANGE_IPV6_REGEX", &regex)) 3231 GNUNET_CONFIGURATION_get_value_string (cfg,
3232 "exit",
3233 "EXIT_RANGE_IPV6_REGEX",
3234 &regex))
3222 regex = GNUNET_strdup ("(0|1)*"); 3235 regex = GNUNET_strdup ("(0|1)*");
3223 GNUNET_MESH_announce_regex (mesh_handle, regex, REGEX_MAX_PATH_LEN_IPV6); 3236 (void) GNUNET_asprintf (&prefixed_regex, "%s%s%s",
3237 GNUNET_APPLICATION_TYPE_EXIT_REGEX_PREFIX,
3238 "6", regex);
3239 GNUNET_MESH_announce_regex (mesh_handle,
3240 prefixed_regex,
3241 REGEX_MAX_PATH_LEN_IPV6);
3224 GNUNET_free (regex); 3242 GNUNET_free (regex);
3243 GNUNET_free (prefixed_regex);
3225 } 3244 }
3226 3245
3227 helper_handle = GNUNET_HELPER_start (GNUNET_NO, 3246 helper_handle = GNUNET_HELPER_start (GNUNET_NO,