mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 23:24:18 +00:00
fix switch_get_addr to work with v6 properly
This commit is contained in:
1 parent
86fcc2c04c
commit
f1430d521a
3 files changed
+19
-2
No files matched your search
+7
-2
@@ -778,9 +778,14 @@ SWITCH_DECLARE(switch_status_t) switch_mcast_loopback(switch_socket_t *sock, uin
|
||||
SWITCH_DECLARE(const char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in)
|
||||
{
|
||||
if (!in) {
|
||||
return "";
|
||||
return SWITCH_BLANK_STRING;
|
||||
}
|
||||
return get_addr(buf, len, (struct sockaddr *) &in->sa, in->salen);
|
||||
|
||||
if (in->family == AF_INET) {
|
||||
return get_addr(buf, len, (struct sockaddr *) &in->sa, in->salen);
|
||||
}
|
||||
|
||||
return get_addr6(buf, len, (struct sockaddr_in6 *) &in->sa, in->salen);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa)
|
||||
|
||||
Reference in new issue
Block a user