Module: kamailio Branch: master Commit: 4045f3d7c0302ae47f0d6c2160160767d56826eb URL: https://github.com/kamailio/kamailio/commit/4045f3d7c0302ae47f0d6c2160160767...
Author: Morten Tryfoss morten@tryfoss.no Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2023-10-11T13:19:04+02:00
cdp: changed format
---
Modified: src/modules/cdp/cdp_mod.c Modified: src/modules/cdp/receiver.c
---
Diff: https://github.com/kamailio/kamailio/commit/4045f3d7c0302ae47f0d6c2160160767... Patch: https://github.com/kamailio/kamailio/commit/4045f3d7c0302ae47f0d6c2160160767...
---
diff --git a/src/modules/cdp/cdp_mod.c b/src/modules/cdp/cdp_mod.c index 5f776f57a1f..963d46c8705 100644 --- a/src/modules/cdp/cdp_mod.c +++ b/src/modules/cdp/cdp_mod.c @@ -239,7 +239,7 @@ static int cdp_init(void) return 1; }
- #if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L if(enable_tls) { init_ssl_methods(); method = tls_parse_method(&tls_method); @@ -248,12 +248,12 @@ static int cdp_init(void) return -1; } } - #else +#else if(enable_tls) { LM_ERR("TLS requires openssl 1.1.0 or newer\n"); return -1; } - #endif +#endif
register_procs(2 + config->workers + 2 * config->peers_cnt); cfg_register_child(2 + config->workers + 2 * config->peers_cnt); diff --git a/src/modules/cdp/receiver.c b/src/modules/cdp/receiver.c index 0a15ce3aaeb..ceee98127f6 100644 --- a/src/modules/cdp/receiver.c +++ b/src/modules/cdp/receiver.c @@ -813,12 +813,12 @@ int receive_loop(peer *original_peer) p->R_sock = fd; }
- #if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L if(enable_tls) { to_ssl(&sp2->tls_ctx, &sp2->tls_conn, sp->tcp_socket, method); } - #endif +#endif } else { sp2 = add_serviced_peer(NULL); if(!sp2) { @@ -826,12 +826,12 @@ int receive_loop(peer *original_peer) continue; } sp2->tcp_socket = fd; - #if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L if(enable_tls) { to_ssl(&sp2->tls_ctx, &sp2->tls_conn, sp->tcp_socket, method); } - #endif +#endif } } } @@ -883,9 +883,9 @@ int receive_loop(peer *original_peer) sp->p ? sp->p->fqdn.s : "", sp->tcp_socket, strerror(errno)); AAAFreeMessage(&msg); - #if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L cleanup_ssl(sp->tls_ctx, sp->tls_conn); - #endif +#endif close(sp->tcp_socket); goto drop_peer; } @@ -898,9 +898,9 @@ int receive_loop(peer *original_peer) sp->p ? sp->p->fqdn.s : "", sp->tcp_socket, cnt, msg->buf.len); AAAFreeMessage(&msg); - #if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if OPENSSL_VERSION_NUMBER >= 0x10100000L cleanup_ssl(sp->tls_ctx, sp->tls_conn); - #endif +#endif close(sp->tcp_socket); goto drop_peer; }