From 4f7f3d04f02537f42084cbd340fa6e61e81c65b5 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Mon, 27 May 2019 12:38:03 +0200 Subject: [PATCH] [crypto] extend reconf checks a bit more (part 1) and make sure to trigger PMTUd recalc on changes Signed-off-by: Fabio M. Di Nitto --- libknet/handle.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libknet/handle.c b/libknet/handle.c index 96ddb7d91..e355a916d 100644 --- a/libknet/handle.c +++ b/libknet/handle.c @@ -1373,11 +1373,11 @@ int knet_handle_crypto(knet_handle_t knet_h, struct knet_handle_crypto_cfg *knet return -1; } - crypto_fini(knet_h); - if ((!strncmp("none", knet_handle_crypto_cfg->crypto_model, 4)) || ((!strncmp("none", knet_handle_crypto_cfg->crypto_cipher_type, 4)) && (!strncmp("none", knet_handle_crypto_cfg->crypto_hash_type, 4)))) { + crypto_fini(knet_h); + force_pmtud_run(knet_h, KNET_SUB_CRYPTO); log_debug(knet_h, KNET_SUB_CRYPTO, "crypto is not enabled"); err = 0; goto exit_unlock; @@ -1399,6 +1399,7 @@ int knet_handle_crypto(knet_handle_t knet_h, struct knet_handle_crypto_cfg *knet goto exit_unlock; } + crypto_fini(knet_h); err = crypto_init(knet_h, knet_handle_crypto_cfg); if (err) { @@ -1406,6 +1407,8 @@ int knet_handle_crypto(knet_handle_t knet_h, struct knet_handle_crypto_cfg *knet savederrno = errno; } + force_pmtud_run(knet_h, KNET_SUB_CRYPTO); + exit_unlock: pthread_rwlock_unlock(&knet_h->global_rwlock); errno = err ? savederrno : 0;