[mdns] Remove ipv4/ipv6 argument to mdns_browse

Make sure mdns_browse() always works the same, and follows user config.
This commit is contained in:
ejurgensen
2021-02-26 22:16:04 +01:00
parent 7871d71a9c
commit dd0f0ece78
7 changed files with 23 additions and 33 deletions

View File

@@ -4363,7 +4363,6 @@ static int
airplay_init(void)
{
int v6enabled;
int family;
int ret;
int i;
@@ -4412,15 +4411,7 @@ airplay_init(void)
goto out_stop_timing;
}
if (v6enabled)
v6enabled = !((timing_6svc.fd < 0) || (control_6svc.fd < 0));
if (v6enabled)
family = AF_UNSPEC;
else
family = AF_INET;
ret = mdns_browse("_airplay._tcp", family, airplay_device_cb, MDNS_CONNECTION_TEST);
ret = mdns_browse("_airplay._tcp", airplay_device_cb, MDNS_CONNECTION_TEST);
if (ret < 0)
{
DPRINTF(E_LOG, L_AIRPLAY, "Could not add mDNS browser for AirPlay devices\n");

View File

@@ -2445,7 +2445,6 @@ static int
cast_init(void)
{
struct decode_ctx *decode_ctx;
int family;
int i;
int ret;
@@ -2484,12 +2483,7 @@ cast_init(void)
goto out_tls_deinit;
}
if (cfg_getbool(cfg_getsec(cfg, "general"), "ipv6"))
family = AF_UNSPEC;
else
family = AF_INET;
ret = mdns_browse("_googlecast._tcp", family, cast_device_cb, 0);
ret = mdns_browse("_googlecast._tcp", cast_device_cb, 0);
if (ret < 0)
{
DPRINTF(E_LOG, L_CAST, "Could not add mDNS browser for Chromecast devices\n");

View File

@@ -4815,7 +4815,6 @@ raop_init(void)
char *ptr;
gpg_error_t gc_err;
int v6enabled;
int family;
int ret;
timing_4svc.fd = -1;
@@ -4900,15 +4899,7 @@ raop_init(void)
goto out_stop_timing;
}
if (v6enabled)
v6enabled = !((timing_6svc.fd < 0) || (control_6svc.fd < 0));
if (v6enabled)
family = AF_UNSPEC;
else
family = AF_INET;
ret = mdns_browse("_raop._tcp", family, raop_device_cb, MDNS_CONNECTION_TEST);
ret = mdns_browse("_raop._tcp", raop_device_cb, MDNS_CONNECTION_TEST);
if (ret < 0)
{
DPRINTF(E_LOG, L_RAOP, "Could not add mDNS browser for AirPlay devices\n");