mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[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:
parent
a22aff5d1f
commit
36a9ed8fe8
@ -2551,13 +2551,11 @@ raop_flush(output_status_cb cb, uint64_t rtptime)
|
|||||||
static void
|
static void
|
||||||
raop_v2_timing_cb(int fd, short what, void *arg)
|
raop_v2_timing_cb(int fd, short what, void *arg)
|
||||||
{
|
{
|
||||||
char address[INET6_ADDRSTRLEN];
|
|
||||||
union sockaddr_all sa;
|
union sockaddr_all sa;
|
||||||
uint8_t req[32];
|
uint8_t req[32];
|
||||||
uint8_t res[32];
|
uint8_t res[32];
|
||||||
struct ntp_stamp recv_stamp;
|
struct ntp_stamp recv_stamp;
|
||||||
struct ntp_stamp xmit_stamp;
|
struct ntp_stamp xmit_stamp;
|
||||||
struct raop_session *rs;
|
|
||||||
struct raop_service *svc;
|
struct raop_service *svc;
|
||||||
int len;
|
int len;
|
||||||
int ret;
|
int ret;
|
||||||
@ -2588,55 +2586,6 @@ raop_v2_timing_cb(int fd, short what, void *arg)
|
|||||||
goto readd;
|
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))
|
if ((req[0] != 0x80) || (req[1] != 0xd2))
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_RAOP, "Packet header doesn't match timing request\n");
|
DPRINTF(E_LOG, L_RAOP, "Packet header doesn't match timing request\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user