Skip to content

Commit

Permalink
[crypto] extend reconf checks a bit more (part 1) and make sure to tr…
Browse files Browse the repository at this point in the history
…igger PMTUd recalc on changes

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed May 27, 2019
1 parent b0e8a6a commit 4f7f3d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libknet/handle.c
Expand Up @@ -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;
Expand All @@ -1399,13 +1399,16 @@ 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) {
err = -2;
savederrno = errno;
}

force_pmtud_run(knet_h, KNET_SUB_CRYPTO);

exit_unlock:
pthread_rwlock_unlock(&knet_h->global_rwlock);
errno = err ? savederrno : 0;
Expand Down

0 comments on commit 4f7f3d0

Please sign in to comment.