mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-18 22:05:40 -05:00
snapcast: support IPv4 link-local addresses
This commit is contained in:
parent
0e80287625
commit
7956d7ceaf
1 changed files with 8 additions and 4 deletions
|
|
@ -640,10 +640,9 @@ static void resolver_cb(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiPr
|
|||
}
|
||||
|
||||
avahi_address_snprint(at, sizeof(at), a);
|
||||
if (spa_strstartswith(at, link_local_range)) {
|
||||
pw_log_info("found link-local ip address %s - skipping tunnel creation", at);
|
||||
goto done;
|
||||
}
|
||||
if (spa_strstartswith(at, link_local_range))
|
||||
pw_log_info("found link-local ip address %s for '%s'", at, name);
|
||||
|
||||
pw_log_info("%s %s", name, at);
|
||||
|
||||
tinfo = TUNNEL_INFO(.name = name, .port = port);
|
||||
|
|
@ -671,6 +670,11 @@ static void resolver_cb(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiPr
|
|||
(a->data.ipv6.address[1] & 0xc0) == 0x80)
|
||||
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.ifindex", "%d", interface);
|
||||
pw_properties_setf(props, "snapcast.port", "%u", port);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue