[raop] Omit timing request source address check

Creates a problem with ipv6 where the timer request source address may
differ from the address that mdns gave us when we created the seesion.
See https://github.com/mikebrady/shairport-sync/issues/254
This commit is contained in:
ejurgensen 2016-03-29 19:36:40 +02:00
parent a22aff5d1f
commit 36a9ed8fe8

View File

@ -2551,13 +2551,11 @@ raop_flush(output_status_cb cb, uint64_t rtptime)
static void
raop_v2_timing_cb(int fd, short what, void *arg)
{
char address[INET6_ADDRSTRLEN];
union sockaddr_all sa;
uint8_t req[32];
uint8_t res[32];
struct ntp_stamp recv_stamp;
struct ntp_stamp xmit_stamp;
struct raop_session *rs;
struct raop_service *svc;
int len;
int ret;
@ -2588,55 +2586,6 @@ raop_v2_timing_cb(int fd, short what, void *arg)
goto readd;
}
switch (sa.ss.ss_family)
{
case AF_INET:
if (svc != &timing_4svc)
goto readd;
for (rs = sessions; rs; rs = rs->next)
{
if ((rs->sa.ss.ss_family == AF_INET)
&& (sa.sin.sin_addr.s_addr == rs->sa.sin.sin_addr.s_addr))
break;
}
if (!rs)
ret = (inet_ntop(AF_INET, &sa.sin.sin_addr.s_addr, address, sizeof(address)) != NULL);
break;
case AF_INET6:
if (svc != &timing_6svc)
goto readd;
for (rs = sessions; rs; rs = rs->next)
{
if ((rs->sa.ss.ss_family == AF_INET6)
&& IN6_ARE_ADDR_EQUAL(&sa.sin6.sin6_addr, &rs->sa.sin6.sin6_addr))
break;
}
if (!rs)
ret = (inet_ntop(AF_INET6, &sa.sin6.sin6_addr.s6_addr, address, sizeof(address)) != NULL);
break;
default:
DPRINTF(E_LOG, L_RAOP, "Time sync: Unknown address family %d\n", sa.ss.ss_family);
goto readd;
}
if (!rs)
{
if (!ret)
DPRINTF(E_LOG, L_RAOP, "Time sync request from [error: %s]; not a RAOP client\n", strerror(errno));
else
DPRINTF(E_LOG, L_RAOP, "Time sync request from %s; not a RAOP client\n", address);
goto readd;
}
if ((req[0] != 0x80) || (req[1] != 0xd2))
{
DPRINTF(E_LOG, L_RAOP, "Packet header doesn't match timing request\n");