summaryrefslogtreecommitdiffstats
path: root/src/methods
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-25 00:20:05 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-25 00:20:05 +0200
commitf34e51a1c3b98df2b7c8c7d7eb415a33f42f2d75 (patch)
tree0edd536548163077da4c22ce7785936a3f9c06a6 /src/methods
parent1b21919d544e30cec89259cfa9353e10852cfc82 (diff)
downloadfastd-f34e51a1c3b98df2b7c8c7d7eb415a33f42f2d75.tar
fastd-f34e51a1c3b98df2b7c8c7d7eb415a33f42f2d75.zip
Make a few struct fields that are not supposed to be changed defines instead
Diffstat (limited to 'src/methods')
-rw-r--r--src/methods/common.c6
-rw-r--r--src/methods/common.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/methods/common.c b/src/methods/common.c
index 17722cf..3fb8561 100644
--- a/src/methods/common.c
+++ b/src/methods/common.c
@@ -30,8 +30,8 @@
void fastd_method_common_init(fastd_method_common_t *session, bool initiator) {
memset(session, 0, sizeof(*session));
- session->valid_till = fastd_in_seconds(conf.key_valid);
- session->refresh_after = fastd_in_seconds(conf.key_refresh - fastd_rand(0, conf.key_refresh_splay));
+ session->valid_till = fastd_in_seconds(KEY_VALID);
+ session->refresh_after = fastd_in_seconds(KEY_REFRESH - fastd_rand(0, KEY_REFRESH_SPLAY));
if (initiator) {
session->send_nonce[COMMON_NONCEBYTES-1] = 3;
@@ -79,7 +79,7 @@ bool fastd_method_reorder_check(fastd_peer_t *peer, fastd_method_common_t *sessi
session->receive_reorder_seen |= (1 << (shift-1));
memcpy(session->receive_nonce, nonce, COMMON_NONCEBYTES);
- session->reorder_timeout = fastd_in_seconds(conf.reorder_time);
+ session->reorder_timeout = fastd_in_seconds(REORDER_TIME);
return true;
}
else if (age == 0 || session->receive_reorder_seen & (1 << (age-1))) {
diff --git a/src/methods/common.h b/src/methods/common.h
index ea4a13a..7b0a4ff 100644
--- a/src/methods/common.h
+++ b/src/methods/common.h
@@ -73,7 +73,7 @@ static inline bool fastd_method_session_common_want_refresh(const fastd_method_c
}
static inline void fastd_method_session_common_superseded(fastd_method_common_t *session) {
- struct timespec valid_max = fastd_in_seconds(conf.key_valid_old);
+ struct timespec valid_max = fastd_in_seconds(KEY_VALID_OLD);
if (timespec_after(&session->valid_till, &valid_max))
session->valid_till = valid_max;