summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-13 15:00:12 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-13 15:00:12 +0200
commit90ab504273a7f186ebb76e6acfb778b4e0d7c91b (patch)
tree031340470af5e29bbba58a2ebf9c0a354c3cb479 /src/resolve
parent92683ad2e28c79891e4123d9a421b018dc58870c (diff)
resolved: skip IPv6 LLMNR if IPv6 is not available
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-link.c10
-rw-r--r--src/resolve/resolved-manager.c25
2 files changed, 22 insertions, 13 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index ed176ab417..7dcaf18630 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -93,7 +93,10 @@ static void link_allocate_scopes(Link *l) {
} else
l->unicast_scope = dns_scope_free(l->unicast_scope);
- if (link_relevant(l, AF_INET) && l->llmnr_support != SUPPORT_NO && l->manager->llmnr_support != SUPPORT_NO) {
+ if (link_relevant(l, AF_INET) &&
+ l->llmnr_support != SUPPORT_NO &&
+ l->manager->llmnr_support != SUPPORT_NO &&
+ l->manager->llmnr_ipv4_udp_fd >= 0) {
if (!l->llmnr_ipv4_scope) {
r = dns_scope_new(l->manager, &l->llmnr_ipv4_scope, l, DNS_PROTOCOL_LLMNR, AF_INET);
if (r < 0)
@@ -102,7 +105,10 @@ 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->llmnr_support != SUPPORT_NO && l->manager->llmnr_support != SUPPORT_NO) {
+ if (link_relevant(l, AF_INET6) &&
+ l->llmnr_support != SUPPORT_NO &&
+ l->manager->llmnr_support != SUPPORT_NO &&
+ l->manager->llmnr_ipv6_udp_fd >= 0) {
if (!l->llmnr_ipv6_scope) {
r = dns_scope_new(l->manager, &l->llmnr_ipv6_scope, l, DNS_PROTOCOL_LLMNR, AF_INET6);
if (r < 0)
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index a2de2edb48..84dad92c53 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -426,23 +426,25 @@ static int manager_llmnr_start(Manager *m) {
if (r < 0)
return r;
- r = manager_llmnr_ipv6_udp_fd(m);
- if (r == -EADDRINUSE)
- goto eaddrinuse;
- if (r < 0)
- return r;
-
r = manager_llmnr_ipv4_tcp_fd(m);
if (r == -EADDRINUSE)
goto eaddrinuse;
if (r < 0)
return r;
- r = manager_llmnr_ipv6_tcp_fd(m);
- if (r == -EADDRINUSE)
- goto eaddrinuse;
- if (r < 0)
- return r;
+ if (socket_ipv6_is_supported()) {
+ r = manager_llmnr_ipv6_udp_fd(m);
+ if (r == -EADDRINUSE)
+ goto eaddrinuse;
+ if (r < 0)
+ return r;
+
+ r = manager_llmnr_ipv6_tcp_fd(m);
+ if (r == -EADDRINUSE)
+ goto eaddrinuse;
+ if (r < 0)
+ return r;
+ }
return 0;
@@ -450,6 +452,7 @@ eaddrinuse:
log_warning("There appears to be another LLMNR respondering running. Turning off LLMNR support.");
m->llmnr_support = SUPPORT_NO;
manager_llmnr_stop(m);
+
return 0;
}