From efcf895bfcee006488d305b5344e49f87c6fd460 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Wed, 28 Dec 2016 18:36:17 +0100 Subject: menc: make it re-entrant --- modules/dtls_srtp/dtls_srtp.c | 7 ++++--- modules/libsrtp/srtp.c | 7 ++++--- modules/srtp/srtp.c | 8 +++++--- modules/zrtp/zrtp.c | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/dtls_srtp/dtls_srtp.c b/modules/dtls_srtp/dtls_srtp.c index 42d5c01..b92ff06 100644 --- a/modules/dtls_srtp/dtls_srtp.c +++ b/modules/dtls_srtp/dtls_srtp.c @@ -452,6 +452,7 @@ static struct menc dtls_srtp2 = { static int module_init(void) { + struct list *mencl = baresip_mencl(); int err; err = tls_alloc(&tls, TLS_METHOD_DTLSV1, NULL, NULL); @@ -477,9 +478,9 @@ static int module_init(void) return err; } - menc_register(&dtls_srtpf); - menc_register(&dtls_srtp); - menc_register(&dtls_srtp2); + menc_register(mencl, &dtls_srtpf); + menc_register(mencl, &dtls_srtp); + menc_register(mencl, &dtls_srtp2); debug("DTLS-SRTP ready with profiles %s\n", srtp_profiles); diff --git a/modules/libsrtp/srtp.c b/modules/libsrtp/srtp.c index cb04c43..db05d64 100644 --- a/modules/libsrtp/srtp.c +++ b/modules/libsrtp/srtp.c @@ -431,6 +431,7 @@ static struct menc menc_srtp_mandf = { static int mod_srtp_init(void) { + struct list *mencl = baresip_mencl(); err_status_t err; err = srtp_init(); @@ -440,9 +441,9 @@ static int mod_srtp_init(void) return ENOSYS; } - menc_register(&menc_srtp_opt); - menc_register(&menc_srtp_mand); - menc_register(&menc_srtp_mandf); + menc_register(mencl, &menc_srtp_opt); + menc_register(mencl, &menc_srtp_mand); + menc_register(mencl, &menc_srtp_mandf); return 0; } diff --git a/modules/srtp/srtp.c b/modules/srtp/srtp.c index c0c9c36..4b2d56c 100644 --- a/modules/srtp/srtp.c +++ b/modules/srtp/srtp.c @@ -385,9 +385,11 @@ static struct menc menc_srtp_mandf = { static int mod_srtp_init(void) { - menc_register(&menc_srtp_opt); - menc_register(&menc_srtp_mand); - menc_register(&menc_srtp_mandf); + struct list *mencl = baresip_mencl(); + + menc_register(mencl, &menc_srtp_opt); + menc_register(mencl, &menc_srtp_mand); + menc_register(mencl, &menc_srtp_mandf); return 0; } diff --git a/modules/zrtp/zrtp.c b/modules/zrtp/zrtp.c index c386a34..feb10a1 100644 --- a/modules/zrtp/zrtp.c +++ b/modules/zrtp/zrtp.c @@ -377,7 +377,7 @@ static int module_init(void) return ENOSYS; } - menc_register(&menc_zrtp); + menc_register(baresip_mencl(), &menc_zrtp); debug("zrtp: cache_file: %s\n", zrtp_config.cache_file_cfg.cache_path); -- cgit v1.2.3