Module: kamailio
Branch: 5.8
Commit: 0e00ae1db0242fc01e6f8c332e3920fd9465b3f9
URL:
https://github.com/kamailio/kamailio/commit/0e00ae1db0242fc01e6f8c332e3920f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-04-01T08:06:21+02:00
core: socket info - parse advertise ip part to get address family
(cherry picked from commit 5f901c3557f9f875545d82a7ab00f6d0c5c1fe52)
---
Modified: src/core/socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0e00ae1db0242fc01e6f8c332e3920f…
Patch:
https://github.com/kamailio/kamailio/commit/0e00ae1db0242fc01e6f8c332e3920f…
---
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index e048e0e2c4b..ab59df73dd6 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -338,6 +338,11 @@ static inline struct socket_info *new_sock_info(char *name,
p = si->useinfo.name.s + 1;
si->useinfo.af = AF_INET6;
} else {
+ ip_addr_t *ipv = NULL;
+ ipv = str2ipx(&si->useinfo.name);
+ if(ipv != NULL) {
+ si->useinfo.af = ipv->af;
+ }
si->useinfo.address_str.len = si->useinfo.name.len;
p = si->useinfo.name.s;
}