mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
Fix up IPv6 address format to enclose it in []
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2406 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
d195d06da7
commit
4b7b7b15d7
1 changed files with 6 additions and 4 deletions
|
|
@ -352,12 +352,14 @@ static void on_connection(pa_socket_client *sc, pa_iochannel *io, void *userdata
|
|||
const char *res = NULL;
|
||||
|
||||
if (AF_INET == sa.sa.sa_family) {
|
||||
res = inet_ntop(sa.sa.sa_family, &sa.in.sin_addr, buf, sizeof(buf));
|
||||
if ((res = inet_ntop(sa.sa.sa_family, &sa.in.sin_addr, buf, sizeof(buf)))) {
|
||||
c->localip = pa_xstrdup(res);
|
||||
}
|
||||
} else if (AF_INET6 == sa.sa.sa_family) {
|
||||
res = inet_ntop(AF_INET6, &sa.in6.sin6_addr, buf, sizeof(buf));
|
||||
if ((res = inet_ntop(AF_INET6, &sa.in6.sin6_addr, buf, sizeof(buf)))) {
|
||||
c->localip = pa_sprintf_malloc("[%s]", res);
|
||||
}
|
||||
}
|
||||
if (res)
|
||||
c->localip = pa_xstrdup(res);
|
||||
}
|
||||
pa_log_debug("Established RTSP connection from local ip %s", c->localip);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue