From ba72724fd1c3547feccb56ae68bd8bed11a3d19a Mon Sep 17 00:00:00 2001 From: Morten Tryfoss Date: Wed, 25 Oct 2023 08:49:53 +0200 Subject: [PATCH] cdp: Fix for undefined symbols when using older/unsupported OpenSSL This was originaly fixed in #3601, but that did not handle the change in #3612 very well. --- src/modules/cdp/receiver.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/cdp/receiver.c b/src/modules/cdp/receiver.c index 223d14dd403..17200cf8143 100644 --- a/src/modules/cdp/receiver.c +++ b/src/modules/cdp/receiver.c @@ -533,6 +533,7 @@ void receiver_process(peer *p) static inline int do_read(serviced_peer_t *sp, char *dst, int n) { +#if OPENSSL_VERSION_NUMBER >= 0x10100000L int cnt, ssl_err; char *err_str; @@ -547,6 +548,11 @@ static inline int do_read(serviced_peer_t *sp, char *dst, int n) } else { cnt = recv(sp->tcp_socket, dst, n, 0); } +#else + int cnt; + + cnt = recv(sp->tcp_socket, dst, n, 0); +#endif return cnt; } @@ -684,6 +690,7 @@ static inline int do_receive(serviced_peer_t *sp) static int do_write(serviced_peer_t *sp, const void *buf, int num) { +#if OPENSSL_VERSION_NUMBER >= 0x10100000L int cnt, ssl_err; char *err_str; @@ -698,6 +705,11 @@ static int do_write(serviced_peer_t *sp, const void *buf, int num) } else { cnt = write(sp->tcp_socket, buf, num); } +#else + int cnt; + + cnt = write(sp->tcp_socket, buf, num); +#endif return cnt; }