X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fresolve%2Fresolved-link.c;h=a4c23bab06a69b2b7d4b9ac14a84ad38ebb33b6d;hb=57f5ad3149b604d07816da61e6aa7dcf1cc56b64;hp=6ac7c5be98e4ce92455c527119f50d5f4198d10c;hpb=623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbf;p=elogind.git diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c index 6ac7c5be9..a4c23bab0 100644 --- a/src/resolve/resolved-link.c +++ b/src/resolve/resolved-link.c @@ -25,8 +25,6 @@ #include "strv.h" #include "resolved-link.h" -#define DEFAULT_TTL (10) - static void link_address_add_rrs(LinkAddress *a); int link_new(Manager *m, Link **ret, int ifindex) { @@ -95,7 +93,7 @@ static void link_allocate_scopes(Link *l) { } else l->unicast_scope = dns_scope_free(l->unicast_scope); - if (link_relevant(l, AF_INET) && l->manager->use_llmnr) { + if (link_relevant(l, AF_INET) && (l->flags & IFF_MULTICAST) && l->manager->use_llmnr) { if (!l->llmnr_ipv4_scope) { r = dns_scope_new(l->manager, &l->llmnr_ipv4_scope, l, DNS_PROTOCOL_LLMNR, AF_INET); if (r < 0) @@ -104,7 +102,7 @@ static void link_allocate_scopes(Link *l) { } else l->llmnr_ipv4_scope = dns_scope_free(l->llmnr_ipv4_scope); - if (link_relevant(l, AF_INET6) && l->manager->use_llmnr) { + if (link_relevant(l, AF_INET6) && (l->flags & IFF_MULTICAST) && l->manager->use_llmnr) { if (!l->llmnr_ipv6_scope) { r = dns_scope_new(l->manager, &l->llmnr_ipv6_scope, l, DNS_PROTOCOL_LLMNR, AF_INET6); if (r < 0) @@ -354,7 +352,7 @@ static void link_address_add_rrs(LinkAddress *a) { } a->llmnr_address_rr->a.in_addr = a->in_addr.in; - a->llmnr_address_rr->ttl = DEFAULT_TTL; + a->llmnr_address_rr->ttl = LLMNR_DEFAULT_TTL; } if (!a->llmnr_ptr_rr) { @@ -362,7 +360,7 @@ static void link_address_add_rrs(LinkAddress *a) { if (r < 0) goto fail; - a->llmnr_ptr_rr->ttl = DEFAULT_TTL; + a->llmnr_ptr_rr->ttl = LLMNR_DEFAULT_TTL; } if (link_address_relevant(a)) { @@ -397,7 +395,7 @@ static void link_address_add_rrs(LinkAddress *a) { } a->llmnr_address_rr->aaaa.in6_addr = a->in_addr.in6; - a->llmnr_address_rr->ttl = DEFAULT_TTL; + a->llmnr_address_rr->ttl = LLMNR_DEFAULT_TTL; } if (!a->llmnr_ptr_rr) { @@ -405,7 +403,7 @@ static void link_address_add_rrs(LinkAddress *a) { if (r < 0) goto fail; - a->llmnr_ptr_rr->ttl = DEFAULT_TTL; + a->llmnr_ptr_rr->ttl = LLMNR_DEFAULT_TTL; } if (link_address_relevant(a)) {