mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-29 00:23:23 -05:00
Ignore ipv6 announcements when ipv6 disabled
This commit is contained in:
parent
e7a73551ab
commit
71d37fc9c7
@ -682,8 +682,12 @@ address_check(const char *hostname, const AvahiAddress *addr, int port, enum mdn
|
|||||||
else
|
else
|
||||||
snprintf(address_log, sizeof(address_log), "[%s]", address);
|
snprintf(address_log, sizeof(address_log), "[%s]", address);
|
||||||
|
|
||||||
if ((addr->proto == AVAHI_PROTO_INET && is_v4ll(&(addr->data.ipv4))) || (addr->proto == AVAHI_PROTO_INET6 && is_v6ll(&(addr->data.ipv6))))
|
if (addr->proto == AVAHI_PROTO_INET6 && (flags & MDNS_IPV4ONLY || !cfg_getbool(cfg_getsec(cfg, "general"), "ipv6"))) {
|
||||||
{
|
DPRINTF(E_WARN, L_MDNS, "Ignoring announcement from %s, address %s is ipv6, but ipv6 is disabled\n", hostname, address_log);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((addr->proto == AVAHI_PROTO_INET && is_v4ll(&(addr->data.ipv4))) || (addr->proto == AVAHI_PROTO_INET6 && is_v6ll(&(addr->data.ipv6)))) {
|
||||||
DPRINTF(E_WARN, L_MDNS, "Ignoring announcement from %s, address %s is link-local\n", hostname, address_log);
|
DPRINTF(E_WARN, L_MDNS, "Ignoring announcement from %s, address %s is link-local\n", hostname, address_log);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user