if (inet_pton(AF_INET, pa_rtsp_localip(c->rtsp), &sa4.sin_addr) > 0) {
sa4.sin_family = af = AF_INET;
sa4.sin_port = htons(port);
+ sa4.sin_addr.s_addr = INADDR_ANY;
sa = (struct sockaddr *) &sa4;
salen = sizeof(sa4);
sa_port = &sa4.sin_port;
} else if (inet_pton(AF_INET6, pa_rtsp_localip(c->rtsp), &sa6.sin6_addr) > 0) {
sa6.sin6_family = af = AF_INET6;
sa6.sin6_port = htons(port);
+ sa6.sin6_addr = in6addr_any;
sa = (struct sockaddr *) &sa6;
salen = sizeof(sa6);
sa_port = &sa6.sin6_port;
int frames = 0;
const char *ip;
char *url;
+ int ipv;
pa_log_debug("RAOP: CONNECTED");
ip = pa_rtsp_localip(c->rtsp);
- url = pa_sprintf_malloc("rtsp://%s/%s", ip, c->sid);
+ if (pa_is_ip6_address(ip)) {
+ ipv = 6;
+ url = pa_sprintf_malloc("rtsp://[%s]/%s", ip, c->sid);
+ } else {
+ ipv = 4;
+ url = pa_sprintf_malloc("rtsp://%s/%s", ip, c->sid);
+ }
pa_rtsp_set_url(c->rtsp, url);
if (c->protocol == PA_RAOP_PROTOCOL_TCP)
case PA_RAOP_ENCRYPTION_NONE: {
sdp = pa_sprintf_malloc(
"v=0\r\n"
- "o=iTunes %s 0 IN IP4 %s\r\n"
+ "o=iTunes %s 0 IN IP%d %s\r\n"
"s=iTunes\r\n"
- "c=IN IP4 %s\r\n"
+ "c=IN IP%d %s\r\n"
"t=0 0\r\n"
"m=audio 0 RTP/AVP 96\r\n"
"a=rtpmap:96 AppleLossless\r\n"
"a=fmtp:96 %d 0 16 40 10 14 2 255 0 0 44100\r\n",
- c->sid, ip, c->host, frames);
+ c->sid, ipv, ip, ipv, c->host, frames);
break;
}
sdp = pa_sprintf_malloc(
"v=0\r\n"
- "o=iTunes %s 0 IN IP4 %s\r\n"
+ "o=iTunes %s 0 IN IP%d %s\r\n"
"s=iTunes\r\n"
- "c=IN IP4 %s\r\n"
+ "c=IN IP%d %s\r\n"
"t=0 0\r\n"
"m=audio 0 RTP/AVP 96\r\n"
"a=rtpmap:96 AppleLossless\r\n"
"a=fmtp:96 %d 0 16 40 10 14 2 255 0 0 44100\r\n"
"a=rsaaeskey:%s\r\n"
"a=aesiv:%s\r\n",
- c->sid, ip, c->host, frames, key, iv);
+ c->sid, ipv, ip, ipv, c->host, frames, key, iv);
pa_xfree(key);
pa_xfree(iv);