Skip to content

Commit 3d71831

Browse files
authored
fix static build with openssl >= 3.2.0 (#240)
Rename tls_free into tport_tls_free as openssl also defines tls_free since version 3.2.0 and openssl/openssl@1853d20 resulting in the following static build failure: /home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/powerpc-buildroot-linux-uclibcspe/8.4.0/../../../../powerpc-buildroot-linux-uclibcspe/bin/ld: /home/autobuild/autobuild/instance-12/output-1/host/bin/../powerpc-buildroot-linux-uclibcspe/sysroot/usr/lib/libssl.a(libssl-lib-tls_common.o): in function `tls_free': tls_common.c:(.text+0x808): multiple definition of `tls_free'; ../libsofia-sip-ua/.libs/libsofia-sip-ua.a(tport_tls.o):tport_tls.c:(.text+0x1128): first defined here Fixes: - http://autobuild.buildroot.org/results/ee862bdafd44c8c56f77e2702ee0a7462634fa0b Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 9e5c40e commit 3d71831

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

libsofia-sip-ua/tport/tport_tls.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ int tls_init_context(tls_t *tls, tls_issues_t const *ti)
460460
return 0;
461461
}
462462

463-
void tls_free(tls_t *tls)
463+
void tport_tls_free(tls_t *tls)
464464
{
465465
int ret;
466466
if (!tls)
@@ -473,7 +473,7 @@ void tls_free(tls_t *tls)
473473
/* The return value -1 means that the connection wasn't actually established */
474474
/* so it should be safe to not call shutdown again. We need to clear the eror */
475475
/* queue for other connections though. */
476-
tls_log_errors(3, "tls_free", 0);
476+
tls_log_errors(3, "tport_tls_free", 0);
477477
ret = 1;
478478
}
479479
} while (ret != 1);
@@ -514,7 +514,7 @@ tls_t *tls_init_master(tls_issues_t *ti)
514514

515515
if (tls_init_context(tls, ti) < 0) {
516516
int err = errno;
517-
tls_free(tls);
517+
tport_tls_free(tls);
518518
errno = err;
519519
return NULL;
520520
}
@@ -544,7 +544,7 @@ tls_t *tls_init_master(tls_issues_t *ti)
544544

545545
if (tls->bio_con == NULL) {
546546
tls_log_errors(1, "tls_init_master", 0);
547-
tls_free(tls);
547+
tport_tls_free(tls);
548548
errno = EIO;
549549
return NULL;
550550
}
@@ -581,7 +581,7 @@ tls_t *tls_init_secondary(tls_t *master, int sock, int accept)
581581

582582
if (tls->con == NULL) {
583583
tls_log_errors(1, "tls_init_secondary", 0);
584-
tls_free(tls);
584+
tport_tls_free(tls);
585585
errno = EIO;
586586
return NULL;
587587
}

libsofia-sip-ua/tport/tport_tls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ typedef struct tport_tls_primary_s {
8181

8282
tls_t *tls_init_master(tls_issues_t *tls_issues);
8383
tls_t *tls_init_secondary(tls_t *tls_master, int sock, int accept);
84-
void tls_free(tls_t *tls);
84+
void tport_tls_free(tls_t *tls);
8585
int tls_get_socket(tls_t *tls);
8686
void tls_log_errors(unsigned level, char const *s, unsigned long e);
8787
ssize_t tls_read(tls_t *tls);

libsofia-sip-ua/tport/tport_type_tls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int tport_tls_init_master(tport_primary_t *pri,
276276
static void tport_tls_deinit_primary(tport_primary_t *pri)
277277
{
278278
tport_tls_primary_t *tlspri = (tport_tls_primary_t *)pri;
279-
tls_free(tlspri->tlspri_master), tlspri->tlspri_master = NULL;
279+
tport_tls_free(tlspri->tlspri_master), tlspri->tlspri_master = NULL;
280280
}
281281

282282
static int tport_tls_init_secondary(tport_t *self, int socket, int accepted,
@@ -303,7 +303,7 @@ static void tport_tls_deinit_secondary(tport_t *self)
303303

304304
/* XXX - PPe: does the tls_shutdown zap everything but socket? */
305305
if (tlstp->tlstp_context != NULL)
306-
tls_free(tlstp->tlstp_context);
306+
tport_tls_free(tlstp->tlstp_context);
307307
tlstp->tlstp_context = NULL;
308308

309309
su_free(self->tp_home, tlstp->tlstp_buffer);

0 commit comments

Comments
 (0)