Commit graph

23887 commits

Author SHA1 Message Date
Tom Gundersen c283267467 Merge pull request #2031 from poettering/resolved-search-domains
resolved. Fully implement search domains for single-label names
2015-11-26 23:58:45 +01:00
Zbigniew Jędrzejewski-Szmek 20cc0ac7a0 man: remove repeated words in description of RandomizedDelay 2015-11-26 16:45:27 -05:00
Zbigniew Jędrzejewski-Szmek 6f5d79986a core: rename Random* to RandomizedDelay*
The name RandomSec is too generic: "Sec" just specifies the default
unit type, and "Random" by itself is not enough. Rename to something
that should give the user general idea what the setting does without
looking at documentation.
2015-11-26 16:32:41 -05:00
Lennart Poettering f7b5b034e8 Merge pull request #1994 from karelzak/rlimits
core: support <soft:hard> ranges for RLIMIT options
2015-11-26 13:17:25 +01:00
Lennart Poettering fedb9a51e6 Merge pull request #2022 from alkino/master
man: Add a not that mount unit cannot be templated
2015-11-26 13:09:56 +01:00
Daniel Mack 845f09c86e Merge pull request #2034 from teg/resolved-fix
minor resolved fixes
2015-11-26 10:56:42 +01:00
Daniel Mack 30e07c7dbc Merge pull request #2035 from evverx/man-fix-io-revents
man: fix function name
2015-11-26 10:55:29 +01:00
Evgeny Vereshchagin 13b6b49fa2 man: fix function name 2015-11-26 07:54:08 +00:00
Tom Gundersen 95d46fcaa4 resolved: bus - follow CNAME chains when resolving addresses
It may be unexpected to find a CNAME record when doing a reverse lookup, as we
expect to find a PTR record directly. However, it is explicitly supported
according to <https://tools.ietf.org/html/rfc2181#section-10.2>, and there
seems to be no benefit to not supporting it.
2015-11-26 04:03:08 +01:00
Tom Gundersen 09eaf68ce4 resolved: do not reject NSEC records with empty bitmaps
The assumption that no NSEC bitmap could be empty due to the presence of the bit representing
the record itself turns out to be flawed. See (the admittedly experimental) RFC4956 for a
counter example.
2015-11-26 04:03:08 +01:00
Lennart Poettering 422baca0f2 dns-domain: rework dns_label_escape() to not imply memory allocation
The new dns_label_escape() call now operates on a buffer passed in,
similar to dns_label_unescape(). This should make decoding a bit faster,
and nicer.
2015-11-25 22:00:07 +01:00
Lennart Poettering 7e8131e9c6 dns-domain: change dns_srv_type_is_valid() return value to bool
For similar reasons as dns_name_is_root() got changed in the previous
commit.
2015-11-25 22:00:07 +01:00
Lennart Poettering dc477e7385 dns-domain: simplify dns_name_is_root() and dns_name_is_single_label()
Let's change the return value to bool. If we encounter an error while
parsing, return "false" instead of the actual parsing error, after all
the specified hostname does not qualify for what the function is
supposed to test.

Dealing with the additional error codes was always cumbersome, and
easily misused, like for example in the DHCP code.

Let's also rename the functions from dns_name_root() to
dns_name_is_root(), to indicate that this function checks something and
returns a bool. Similar for dns_name_is_signal_label().
2015-11-25 22:00:07 +01:00
Lennart Poettering 801ad6a6a9 resolved: fully support DNS search domains
This adds support for searching single-label hostnames in a set of
configured search domains.

A new object DnsQueryCandidate is added that links queries to scopes.
It keeps track of the search domain last used for a query on a specific
link. Whenever a host name was unsuccessfuly resolved on a scope all its
transactions are flushed out and replaced by a new set, with the next
search domain appended.

This also adds a new flag SD_RESOLVED_NO_SEARCH to disable search domain
behaviour. The "systemd-resolve-host" tool is updated to make this
configurable via --search=.

Fixes #1697
2015-11-25 21:59:16 +01:00
Lennart Poettering 7f220d94a9 resolved: expose some properties on the bus
For now, let's just expose the LLMNR hostname currently in use;  a
combined list of all dns servers with their interface indexes; a
combined list of all search domains with their interface indexes.
2015-11-25 21:58:38 +01:00
Lennart Poettering 9176a57c10 resolved: split out calls to compile full list of dns servers and search domains
Let's split this out from the resolv.conf parser, so that this becomes
generically useful.
2015-11-25 21:58:38 +01:00
Lennart Poettering 0264d0726f util-lib: add ordered_set_ensure_allocated()
ordered_set_ensure_allocated() does for an OrderedSet, what
set_ensure_allicated() does for a Set.
2015-11-25 21:58:38 +01:00
Lennart Poettering eed857b717 resolved: enforce a maximum limit on both dns servers and search domains 2015-11-25 21:58:38 +01:00
Lennart Poettering 4b95f1798f resolved: unify DnsServer handling code between Link and Manager
This copies concepts we introduced for the DnsSearchDomain stuff, and
reworks the operations on lists of dns servers to be reusable and
generic for use both with the Link and the Manager object.
2015-11-25 21:58:38 +01:00
Lennart Poettering a51c10485a resolved: add a generic DnsSearchDomain concept
With this change, we add a new object to resolved, "DnsSearchDomain="
which wraps a search domain. This is then used to introduce a global
search domain list, in addition to the existing per-link search domain
list which is reword to make use of this new object too.

This is preparation for implement proper unicast DNS search domain
support.
2015-11-25 21:58:38 +01:00
Lennart Poettering 0b58db658b resolved: make sure order of dns servers is stable
Previously, we'd keep adding new dns servers we discover to the end of
our linked list of servers. When we encountered a pre-existing server,
we'd just leave it where it was. In essence that meant that old servers
ended up at the front, and new servers at the end, but not in an order
that would reflect the configuration.

With this change we ensure that every pre-existing server we want to add
again we move to the back of the linked list, so that the order is
stable and in sync with the requested configuration.
2015-11-25 21:58:38 +01:00
Lennart Poettering 444d77fd01 resolved: drop unused enum type 2015-11-25 21:58:37 +01:00
Lennart Poettering 00fa60ae3b resolved: make sure FallbackDNS= overrides built-in servers, doesn't extend them
Closes #342.
2015-11-25 21:58:37 +01:00
Lennart Poettering 0eac462399 resolved: rework dns server lifecycle logic
Previously, there was a chance of memory corruption, because when
switching to the next DNS server we didn't care whether they linked list
of DNS servers was still valid.

Clean up lifecycle of the dns server logic:

- When a DnsServer object is still in the linked list of DnsServers for
  a link or the manager, indicate so with a "linked" boolean field, and
  never follow the linked list if that boolean is not set.

- When picking a DnsServer to use for a link ot manager, always
  explicitly take a reference.

This also rearranges some logic, to make the tracking of dns servers by
link and globally more alike.
2015-11-25 21:58:37 +01:00
Lennart Poettering f2f1dbe50f resolved: move dns server picking code from resolved-manager.c to resolved-dns-server.c 2015-11-25 21:58:37 +01:00
Lennart Poettering 84129d46cd resolved: indent less, by exiting earlier 2015-11-25 21:58:37 +01:00
Lennart Poettering f8dc7e343d resolved: split out all code dealing with /etc/resolv.conf into its own .c file
No functional changes.
2015-11-25 21:58:37 +01:00
Lennart Poettering 636e813dc9 resolved: unify code for parsing dns server information
Let's use the same parser when parsing dns server information from
/etc/resolv.conf and our native configuration file.

Also, move all code that manages lists of dns servers to a single place.
resolved-dns-server.c
2015-11-25 21:58:37 +01:00
Lennart Poettering e3528a5c46 resolved: /etc/resolved.conf missing is not an error
Don't propagate any error in this case, it's really not an error.
2015-11-25 21:58:37 +01:00
Lennart Poettering 97f1b2f354 dns-domain: remove prototype for function that doesn't exist 2015-11-25 21:58:37 +01:00
Lennart Poettering 9f2912db78 man: fix documentation how /etc/resolv.conf is read
/etc/resolv.conf is only read when the DNS= setting does not appear at
all in resolved.conf, regardless if set to the empty list or anything
else. Correct that in the man page.
2015-11-25 21:58:37 +01:00
Lennart Poettering 703e4f5e39 resolved: don't claim DnsQuestion have to have the same names
Wen DnsQuestion objects are used for DnsQuery objects all contained keys
have to share the same name, but otherwise they generally don't have to,
and this can actually happen in real-life because DnsPacket objects for
mDNS use DnsQuestion for the question section.

Hence, rename:

dns_question_is_valid() to dns_question_is_valid_for_query(), since the
name uniqueness check it does is only relevant when used for a query.

Similar, rename dns_question_name() to dns_question_first_name(),
to be more accurate, as this difference matters if we keys don#t have to
share the same name.
2015-11-25 21:58:32 +01:00
Franck Bui 0d3d3be1e2 fstab-gen: post can't be NULL 2015-11-25 21:21:44 +01:00
Tom Gundersen ac7653a433 Merge pull request #2024 from eworm-de/net
networkd: link - do not drop config for loopback device
2015-11-25 20:56:46 +01:00
Christian Hesse e5d44b34cc networkd: link - do not drop config for loopback device
Commit 5e5b137a (networkd: link - drop foreign config when configuring
link) introduced a regression where addresses (including 127.0.0.1) are
removed from loopback device.
Do not handle loopback device when removing foreign configs.

Signed-off-by: Christian Hesse <mail@eworm.de>
2015-11-25 20:02:53 +01:00
Evgeny Vereshchagin cd949ee734 tests: don't run tests on incomplete setup 2015-11-25 17:51:17 +00:00
Tom Gundersen f693e9b38f sd-dhcp: parse error message in DECLINE or NAK
If a client sends a DECLINE or a server sends a NAK, they can include
a string with a message to explain the error. Parse this and print it
at debug level.
2015-11-25 18:30:31 +01:00
Tom Gundersen cddf4d81ea sd-ndisc: better validate RA packets
Verify the hoplimit and that the received packet is large enough for the RA
header.

See <http://tools.ietf.org/html/rfc4861#section-6.1.2>.
2015-11-25 18:30:31 +01:00
Tom Gundersen 6d06ac1faa sd-ndisc: always send the link-layer address
We never send packets without first knowing the link-local L3 address,
so we should always include the L2 address in RS packets.
2015-11-25 18:30:31 +01:00
Tom Gundersen 0d43d2fcb7 libsystemd-network: clean up recv functions 2015-11-25 18:30:31 +01:00
Daniel Mack af143e3b69 Merge pull request #2027 from evverx/remove-unnecessary-cgroup-systemd-checking
tests: remove unnecessary /sys/fs/cgroup/systemd checking
2015-11-25 14:44:48 +01:00
Evgeny Vereshchagin 55161d41eb tests: remove unnecessary /sys/fs/cgroup/systemd checking
A unified hierarchy obsoletes this checking
2015-11-25 11:43:58 +00:00
Karel Zak 91518d20dd core: support <soft:hard> ranges for RLIMIT options
The new parser supports:

 <value>       - specify both limits to the same value
 <soft:hard>   - specify both limits

the size or time specific suffixes are supported, for example

  LimitRTTIME=1sec
  LimitAS=4G:16G

The patch introduces parse_rlimit_range() and rlim type (size, sec,
usec, etc.) specific parsers. No code is duplicated now.

The patch also sync docs for DefaultLimitXXX= and LimitXXX=.

References: https://github.com/systemd/systemd/issues/1769
2015-11-25 12:03:32 +01:00
Lennart Poettering 91f5f21332 Merge pull request #2020 from evverx/signals-completion
bash-completion: list valid signal names
2015-11-24 23:07:10 +01:00
Tom Gundersen dd6f132af4 Merge pull request #2021 from phomes/minor-fixes2
resolved: remove unused variable
2015-11-24 18:43:59 +01:00
Nicolas Cornu cc8454d522 man: Add a not that mount unit cannot be templated 2015-11-24 18:24:57 +01:00
Thomas Hindoe Paaboel Andersen 6617082bc8 resolved: remove unused variable 2015-11-24 17:10:32 +01:00
Evgeny Vereshchagin c2af810150 bash-completion: list valid signal names
this is a follow-up for commit 18540892d1
2015-11-24 16:05:42 +00:00
Lennart Poettering aad2652326 Merge pull request #1991 from evverx/use-systems-nspawn
tests: don't rely on system's machined
2015-11-24 16:24:24 +01:00
Lennart Poettering 68e038572b Merge pull request #2018 from keszybz/kill-signal
bash-completion: list only valid signal names
2015-11-24 16:21:47 +01:00