summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-link.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-05 17:32:25 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-05 17:41:41 +0100
commitaaa297d4e5401fd4466632555432774863457f1d (patch)
treefba0368e1037d4cd02760fce8dc6450d819de72b /src/resolve/resolved-link.c
parentaf49ca27ffd790d78dbbb465b978266dfd5c93da (diff)
networkd,resolved: add a per-interface mdns configuration option
Diffstat (limited to 'src/resolve/resolved-link.c')
-rw-r--r--src/resolve/resolved-link.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 6202ddeca1..a1f28633ba 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -246,6 +246,33 @@ clear:
return r;
}
+static int link_update_mdns_support(Link *l) {
+ _cleanup_free_ char *b = NULL;
+ int r;
+
+ assert(l);
+
+ r = sd_network_link_get_mdns(l->ifindex, &b);
+ if (r == -ENODATA) {
+ r = 0;
+ goto clear;
+ }
+ if (r < 0)
+ goto clear;
+
+ l->mdns_support = resolve_support_from_string(b);
+ if (l->mdns_support < 0) {
+ r = -EINVAL;
+ goto clear;
+ }
+
+ return 0;
+
+clear:
+ l->mdns_support = RESOLVE_SUPPORT_NO;
+ return r;
+}
+
static int link_update_search_domains(Link *l) {
_cleanup_strv_free_ char **domains = NULL;
char **i;
@@ -295,6 +322,7 @@ int link_update_monitor(Link *l) {
link_update_dns_servers(l);
link_update_llmnr_support(l);
+ link_update_mdns_support(l);
link_allocate_scopes(l);
r = link_update_search_domains(l);