[systemd-commits] 6 commits - TODO man/resolved.conf.xml src/network src/resolve
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Aug 4 14:09:27 PDT 2014
TODO | 3 +
man/resolved.conf.xml | 67 ++++++++++++++++++++++++++++++++++++-----
src/network/sd-network.c | 5 +++
src/resolve/resolved-link.c | 37 +++++++++++++++++++++-
src/resolve/resolved-link.h | 2 +
src/resolve/resolved-manager.c | 4 ++
src/resolve/resolved-manager.h | 17 +++++-----
7 files changed, 117 insertions(+), 18 deletions(-)
New commits:
commit 21d73c87b09ec2b8642424bc714ce9af3da4fc40
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 4 23:08:49 2014 +0200
resolved: actually read the initial state data from networkd when we initialize
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index db346cc..1288395 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -77,6 +77,10 @@ static int manager_process_link(sd_rtnl *rtnl, sd_rtnl_message *mm, void *userda
if (r < 0)
goto fail;
+ r = link_update_monitor(l);
+ if (r < 0)
+ goto fail;
+
if (is_new)
log_debug("Found new link %i/%s", ifindex, l->name);
commit 252f2b9e854dced09cf0968417d1868e5fa90a06
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 4 23:08:31 2014 +0200
man: bring resolved.conf up-to-date
diff --git a/man/resolved.conf.xml b/man/resolved.conf.xml
index 04e510f..6e0185b 100644
--- a/man/resolved.conf.xml
+++ b/man/resolved.conf.xml
@@ -56,8 +56,8 @@
<para>When starting, systemd-resolved will read the
configuration file <filename>resolved.conf</filename>.
- This configuration file determines the fallback DNS
- servers.</para>
+ This configuration file controls local DNS name
+ resolving.</para>
</refsect1>
@@ -68,12 +68,62 @@
<varlistentry>
<term><varname>DNS=</varname></term>
- <listitem><para>A space separated list of IPv4 and IPv6
- addresses to be used as the fallback DNS servers. Note that
- the servers obtained from
+ <listitem><para>A space separated list
+ of IPv4 and IPv6 addresses to be used
+ as system DNS servers. DNS requests
+ are sent to one of the listed DNS
+ servers in parallel to any
+ per-interface DNS servers acquired
+ from
+ <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. For
+ compatibility reasons, if set to the
+ empty list the DNS servers listed in
+ <filename>/etc/resolv.conf</filename>
+ are used, if any are
+ configured there. This setting
+ defaults to the empty
+ list.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>FallbackDNS=</varname></term>
+ <listitem><para>A space separated list
+ of IPv4 and IPv6 addresses to be used
+ as the fallback DNS servers. Any
+ per-interface DNS servers obtained
+ from
+ <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ take precedence over this setting, as
+ do any servers set via
+ <varname>DNS=</varname> above or
+ <filename>/etc/resolv.conf</filename>. This
+ setting is hence only used if no other
+ DNS server information is known. If
+ this option is not given, a
+ compiled-in list of DNS servers is
+ used instead.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>LLMNR=</varname></term>
+ <listitem><para>Takes a boolean
+ argument or
+ <literal>resolve</literal>. Controls
+ Link-Local Multicast Name Resolution support (<ulink
+ url="https://tools.ietf.org/html/rfc4795">RFC
+ 4794</ulink>) on the local host. If
+ true enables full LLMNR responder and
+ resolver support. If false disable
+ both. If set to
+ <literal>resolve</literal> only
+ resolving support is enabled, but
+ responding is disabled. Note that
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- take precedence. If this option is not given, a compiled-in
- list of DNS servers is used instead.</para></listitem>
+ also maintains per-interface LLMNR
+ settings. LLMNR will be enabled on an
+ interface only if the per-interface
+ and the global setting is
+ on.</para></listitem>
</varlistentry>
</variablelist>
@@ -84,7 +134,8 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-resolved.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>resolv.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry>
</para>
</refsect1>
commit 23c4091dc2b85d117512e89233fdeb47d1ff3d92
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 4 23:08:13 2014 +0200
update TODO
diff --git a/TODO b/TODO
index 176054e..9e322b3 100644
--- a/TODO
+++ b/TODO
@@ -40,6 +40,9 @@ Features:
- collect multiple responses
- jitter interval support
- reprobe after suspend
+ - enforce packet rate limit
+ - DNS
+ - search paths
- mDNS/DNS-SD
- avahi compat
- DNS-SD service registration from socket units
commit 19b50b5ba7ee8c1bfb330377309e4bab7a7531d8
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 4 23:08:03 2014 +0200
resolved: read the per-interface LLMNR setting from networkd and act on it
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 2c02f09..e1cdd60 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -42,6 +42,7 @@ int link_new(Manager *m, Link **ret, int ifindex) {
return -ENOMEM;
l->ifindex = ifindex;
+ l->llmnr_support = SUPPORT_YES;
r = hashmap_put(m->links, INT_TO_PTR(ifindex), l);
if (r < 0)
@@ -92,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->llmnr_support != SUPPORT_NO) {
+ if (link_relevant(l, AF_INET) && l->llmnr_support != SUPPORT_NO && l->manager->llmnr_support != SUPPORT_NO) {
if (!l->llmnr_ipv4_scope) {
r = dns_scope_new(l->manager, &l->llmnr_ipv4_scope, l, DNS_PROTOCOL_LLMNR, AF_INET);
if (r < 0)
@@ -101,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->llmnr_support != SUPPORT_NO) {
+ if (link_relevant(l, AF_INET6) && l->llmnr_support != SUPPORT_NO && l->manager->llmnr_support != SUPPORT_NO) {
if (!l->llmnr_ipv6_scope) {
r = dns_scope_new(l->manager, &l->llmnr_ipv6_scope, l, DNS_PROTOCOL_LLMNR, AF_INET6);
if (r < 0)
@@ -188,10 +189,40 @@ clear:
return r;
}
+static int link_update_llmnr_support(Link *l) {
+ _cleanup_free_ char *b = NULL;
+ int r;
+
+ assert(l);
+
+ r = sd_network_get_llmnr(l->ifindex, &b);
+ if (r < 0)
+ goto clear;
+
+ r = parse_boolean(b);
+ if (r < 0) {
+ if (streq(b, "resolve"))
+ l->llmnr_support = SUPPORT_RESOLVE;
+ else
+ goto clear;
+
+ } else if (r > 0)
+ l->llmnr_support = SUPPORT_YES;
+ else
+ l->llmnr_support = SUPPORT_NO;
+
+ return 0;
+
+clear:
+ l->llmnr_support = SUPPORT_YES;
+ return r;
+}
+
int link_update_monitor(Link *l) {
assert(l);
link_update_dns_servers(l);
+ link_update_llmnr_support(l);
link_allocate_scopes(l);
link_add_rrs(l, false);
@@ -353,6 +384,7 @@ void link_address_add_rrs(LinkAddress *a, bool force_remove) {
if (!force_remove &&
link_address_relevant(a) &&
a->link->llmnr_ipv4_scope &&
+ a->link->llmnr_support == SUPPORT_YES &&
a->link->manager->llmnr_support == SUPPORT_YES) {
if (!a->link->manager->host_ipv4_key) {
@@ -409,6 +441,7 @@ void link_address_add_rrs(LinkAddress *a, bool force_remove) {
if (!force_remove &&
link_address_relevant(a) &&
a->link->llmnr_ipv6_scope &&
+ a->link->llmnr_support == SUPPORT_YES &&
a->link->manager->llmnr_support == SUPPORT_YES) {
if (!a->link->manager->host_ipv6_key) {
diff --git a/src/resolve/resolved-link.h b/src/resolve/resolved-link.h
index 38bb392..af9a8ab 100644
--- a/src/resolve/resolved-link.h
+++ b/src/resolve/resolved-link.h
@@ -59,6 +59,8 @@ struct Link {
LIST_HEAD(DnsServer, dns_servers);
DnsServer *current_dns_server;
+ Support llmnr_support;
+
DnsScope *unicast_scope;
DnsScope *llmnr_ipv4_scope;
DnsScope *llmnr_ipv6_scope;
diff --git a/src/resolve/resolved-manager.h b/src/resolve/resolved-manager.h
index 1fd4be4..9d824e1 100644
--- a/src/resolve/resolved-manager.h
+++ b/src/resolve/resolved-manager.h
@@ -30,20 +30,21 @@
#include "hashmap.h"
typedef struct Manager Manager;
+typedef enum Support Support;
-#include "resolved-dns-query.h"
-#include "resolved-dns-server.h"
-#include "resolved-dns-scope.h"
-#include "resolved-dns-stream.h"
-#include "resolved-link.h"
-
-typedef enum Support {
+enum Support {
SUPPORT_NO,
SUPPORT_YES,
SUPPORT_RESOLVE,
_SUPPORT_MAX,
_SUPPORT_INVALID = -1
-} Support;
+};
+
+#include "resolved-dns-query.h"
+#include "resolved-dns-server.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-stream.h"
+#include "resolved-link.h"
struct Manager {
sd_event *event;
commit b3df0b34c14ffdaf8f2d72c08ff59da14cd6f7d7
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 4 23:06:05 2014 +0200
sd-network: when the LLMNR setting is not known for an interface consider that as ENODATA
ENODATA should be returned whenever we have no idea about something. A
missing LLMNR setting can only really happen during upgrades, in whichc
ase we really have no idea, so let's turn this into another ENODATA
case.
diff --git a/src/network/sd-network.c b/src/network/sd-network.c
index 260ca47..ed02ecc 100644
--- a/src/network/sd-network.c
+++ b/src/network/sd-network.c
@@ -122,6 +122,8 @@ _public_ int sd_network_get_llmnr(int ifindex, char **llmnr) {
return -ENODATA;
else if (r < 0)
return r;
+ else if (!s)
+ return -ENODATA;
*llmnr = s;
s = NULL;
commit 2cd666f8c93d2fc27566bd16f21fba1043735729
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 4 23:05:26 2014 +0200
sd-network: actually open the state file in sd_network_get_llmnr()
diff --git a/src/network/sd-network.c b/src/network/sd-network.c
index a0f147e..260ca47 100644
--- a/src/network/sd-network.c
+++ b/src/network/sd-network.c
@@ -114,6 +114,9 @@ _public_ int sd_network_get_llmnr(int ifindex, char **llmnr) {
assert_return(ifindex > 0, -EINVAL);
assert_return(llmnr, -EINVAL);
+ if (asprintf(&p, "/run/systemd/netif/links/%d", ifindex) < 0)
+ return -ENOMEM;
+
r = parse_env_file(p, NEWLINE, "LLMNR", &s, NULL);
if (r == -ENOENT)
return -ENODATA;
More information about the systemd-commits
mailing list