Skip to content

Commit a4a4d9a

Browse files
committed
TELCORE-120: fix mod_xml_rpc 2019 in_addr_t/in_addr ptr-type bug for gcc 14
Bundled libs/xmlrpc-c declares ServerCreate(... struct in_addr * const addrP, ...) but the 2019 telnyx fork patch (cf68bd0) backing IP-bind support declared the local as in_addr_t (a uint32_t) and passed &addr. gcc <= 13 reported this as -Wincompatible-pointer-types (warning); gcc 14 (Debian Trixie default) promotes it to a hard error. Wire behavior is unchanged - struct in_addr is just { uint32_t s_addr; } - we just store the address through s_addr now.
1 parent 6e643f4 commit a4a4d9a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,12 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
13401340
switch_hash_index_t *hi;
13411341
const void *var;
13421342
void *val;
1343-
in_addr_t addr;
1343+
// The bundled xmlrpc-c's ServerCreate() takes `struct in_addr *` for the
1344+
// bind-address arg; the original telnyx fork patch (cf68bd0164a, 2019)
1345+
// declared this as `in_addr_t` (a uint32_t). gcc <= 13 reported it as a
1346+
// -Wincompatible-pointer-types warning; gcc 14 (Debian Trixie default)
1347+
// makes it a hard error.
1348+
struct in_addr addr;
13441349

13451350
//
13461351
// Lock the global mutex. ssl_init is not threadsafe
@@ -1353,7 +1358,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
13531358
globals.registryP = xmlrpc_registry_new(&env);
13541359

13551360
if (globals.addr) {
1356-
addr = inet_addr(globals.addr);
1361+
addr.s_addr = inet_addr(globals.addr);
13571362
}
13581363

13591364
/* TODO why twice and why add_method for freeswitch.api and add_method2 for freeswitch.management ? */

0 commit comments

Comments
 (0)