Module: kamailio
Branch: master
Commit: faf24134a00c1b15933f22e8e7702ec8e0dba35d
URL:
https://github.com/kamailio/kamailio/commit/faf24134a00c1b15933f22e8e7702ec…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-08T11:43:02+01:00
core: keep address family indication in advertised structure
---
Modified: src/core/ip_addr.h
Modified: src/core/socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/faf24134a00c1b15933f22e8e7702ec…
Patch:
https://github.com/kamailio/kamailio/commit/faf24134a00c1b15933f22e8e7702ec…
---
diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h
index cec63fc4fa9..a8f9660b9c6 100644
--- a/src/core/ip_addr.h
+++ b/src/core/ip_addr.h
@@ -122,6 +122,7 @@ typedef struct advertise_info
{
str name; /* name - eg.: foo.bar or 10.0.0.1 */
int proto; /* protocol id */
+ int af; /* address family based on [ ] around name */
unsigned short port_no; /* port number */
short port_pad; /* padding field */
str port_no_str; /* port number converted to string -- optimization*/
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index caad839ee8f..3f67f16981b 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -336,6 +336,7 @@ static inline struct socket_info *new_sock_info(char *name,
if(usename[0] == '[' && usename[si->useinfo.name.len - 1] ==
']') {
si->useinfo.address_str.len = si->useinfo.name.len - 2;
p = si->useinfo.name.s + 1;
+ si->useinfo.af = AF_INET6;
} else {
si->useinfo.address_str.len = si->useinfo.name.len;
p = si->useinfo.name.s;