avahi: Ignore local services.
* guix/avahi.scm (avahi-browse-service-thread): Add "ignore-local?" argument and honor it.
This commit is contained in:
parent
71dd1be597
commit
0faef87178
@ -92,6 +92,7 @@ when STOP-LOOP? procedure returns true."
|
|||||||
(define* (avahi-browse-service-thread proc
|
(define* (avahi-browse-service-thread proc
|
||||||
#:key
|
#:key
|
||||||
types
|
types
|
||||||
|
(ignore-local? #t)
|
||||||
(family AF_INET)
|
(family AF_INET)
|
||||||
(stop-loop? (const #f))
|
(stop-loop? (const #f))
|
||||||
(timeout 100))
|
(timeout 100))
|
||||||
@ -116,7 +117,9 @@ when STOP-LOOP? procedure returns true."
|
|||||||
;; Add the service if the host is unknown. This means that if a
|
;; Add the service if the host is unknown. This means that if a
|
||||||
;; service is available on multiple network interfaces for a single
|
;; service is available on multiple network interfaces for a single
|
||||||
;; host, only the first interface found will be considered.
|
;; host, only the first interface found will be considered.
|
||||||
(unless (hash-ref %known-hosts service-name)
|
(unless (or (hash-ref %known-hosts service-name)
|
||||||
|
(and ignore-local?
|
||||||
|
(member lookup-result-flag/local flags)))
|
||||||
(let* ((address (inet-ntop family address))
|
(let* ((address (inet-ntop family address))
|
||||||
(local-address (interface->ip-address interface))
|
(local-address (interface->ip-address interface))
|
||||||
(service* (avahi-service
|
(service* (avahi-service
|
||||||
|
Loading…
Reference in New Issue
Block a user