summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 19:09:55 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 19:09:55 +0100
commit96a14063ce55023878fe4d7509b08cc5d9c4b919 (patch)
tree10528d645f9c7b9da8951c4df11dc34f3e58c0ca
parentc13bdcefe7ce4974e6d510b38bdca9899e536d56 (diff)
downloadfastd-96a14063ce55023878fe4d7509b08cc5d9c4b919.tar
fastd-96a14063ce55023878fe4d7509b08cc5d9c4b919.zip
config: iterate over configured methods only in configure_method_parameters()
-rw-r--r--src/config.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c
index 07f680c..7958ffb 100644
--- a/src/config.c
+++ b/src/config.c
@@ -591,13 +591,15 @@ static void configure_method_parameters(fastd_context_t *ctx, fastd_config_t *co
conf->min_encrypt_tail_space = 0;
conf->min_decrypt_tail_space = 0;
- int i;
- for (i = 0; METHODS[i]; i++) {
- conf->max_packet_size = max_size_t(conf->max_packet_size, METHODS[i]->max_packet_size(ctx));
- conf->min_encrypt_head_space = max_size_t(conf->min_encrypt_head_space, METHODS[i]->min_encrypt_head_space(ctx));
- conf->min_decrypt_head_space = max_size_t(conf->min_decrypt_head_space, METHODS[i]->min_decrypt_head_space(ctx));
- conf->min_encrypt_tail_space = max_size_t(conf->min_encrypt_tail_space, METHODS[i]->min_encrypt_tail_space(ctx));
- conf->min_decrypt_tail_space = max_size_t(conf->min_decrypt_tail_space, METHODS[i]->min_decrypt_tail_space(ctx));
+ fastd_string_stack_t *method_name;
+ for (method_name = conf->methods; method_name; method_name = method_name->next) {
+ const fastd_method_t *method = fastd_parse_method_name(method_name->str);
+
+ conf->max_packet_size = max_size_t(conf->max_packet_size, method->max_packet_size(ctx));
+ conf->min_encrypt_head_space = max_size_t(conf->min_encrypt_head_space, method->min_encrypt_head_space(ctx));
+ conf->min_decrypt_head_space = max_size_t(conf->min_decrypt_head_space, method->min_decrypt_head_space(ctx));
+ conf->min_encrypt_tail_space = max_size_t(conf->min_encrypt_tail_space, method->min_encrypt_tail_space(ctx));
+ conf->min_decrypt_tail_space = max_size_t(conf->min_decrypt_tail_space, method->min_decrypt_tail_space(ctx));
}
conf->min_encrypt_head_space = alignto(conf->min_encrypt_head_space, 16);