mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-06 07:15:35 -04:00
snapcast: support IPv4 link-local addresses
This commit is contained in:
parent
8f544782d2
commit
50905a2d18
1 changed files with 8 additions and 4 deletions
|
|
@ -628,10 +628,9 @@ static void resolver_cb(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiPr
|
||||||
}
|
}
|
||||||
|
|
||||||
avahi_address_snprint(at, sizeof(at), a);
|
avahi_address_snprint(at, sizeof(at), a);
|
||||||
if (spa_strstartswith(at, link_local_range)) {
|
if (spa_strstartswith(at, link_local_range))
|
||||||
pw_log_info("found link-local ip address %s - skipping tunnel creation", at);
|
pw_log_info("found link-local ip address %s for '%s'", at, name);
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
pw_log_info("%s %s", name, at);
|
pw_log_info("%s %s", name, at);
|
||||||
|
|
||||||
tinfo = TUNNEL_INFO(.name = name, .port = port);
|
tinfo = TUNNEL_INFO(.name = name, .port = port);
|
||||||
|
|
@ -659,6 +658,11 @@ static void resolver_cb(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiPr
|
||||||
(a->data.ipv6.address[1] & 0xc0) == 0x80)
|
(a->data.ipv6.address[1] & 0xc0) == 0x80)
|
||||||
snprintf(if_suffix, sizeof(if_suffix), "%%%d", interface);
|
snprintf(if_suffix, sizeof(if_suffix), "%%%d", interface);
|
||||||
|
|
||||||
|
/* For IPv4 link-local, bind to the discovery interface */
|
||||||
|
if (a->proto == AVAHI_PROTO_INET &&
|
||||||
|
spa_strstartswith(at, link_local_range))
|
||||||
|
snprintf(if_suffix, sizeof(if_suffix), "%%%d", interface);
|
||||||
|
|
||||||
pw_properties_setf(props, "snapcast.ip", "%s%s", at, if_suffix);
|
pw_properties_setf(props, "snapcast.ip", "%s%s", at, if_suffix);
|
||||||
pw_properties_setf(props, "snapcast.ifindex", "%d", interface);
|
pw_properties_setf(props, "snapcast.ifindex", "%d", interface);
|
||||||
pw_properties_setf(props, "snapcast.port", "%u", port);
|
pw_properties_setf(props, "snapcast.port", "%u", port);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue