Commit graph

40 commits

Author SHA1 Message Date
Tom Gundersen a9feff3d77 resolved: write resolv.conf search - switch arguments
Found by Lukáš Nykrýn.
2014-08-20 15:56:18 +02:00
David Herrmann bf32f99f65 resolve: fix compilation on LLVM+clang
LLVM+clang does not allow statement-expressions inside of
type-declarations (file-scope). Use CONST_MAX() to avoid this.
2014-08-15 16:59:09 +02:00
Tom Gundersen bda2c408f8 resolved: pull in domain names from sd-network 2014-08-14 23:38:38 +02:00
Lennart Poettering 90ab504273 resolved: skip IPv6 LLMNR if IPv6 is not available 2014-08-13 15:00:12 +02:00
Lennart Poettering 3e684349c2 resolved: unify logic how we flush out DNS servers we learnt 2014-08-12 19:32:55 +02:00
Lennart Poettering 87f5a19343 resolved: filter out duplicate DNS servers when writing resolv.conf 2014-08-12 13:02:27 +02:00
Lennart Poettering 556a22945f resolved: when picking a new hostname make sure two hosts pick different ones
This way we can avoid always picking the same replacement hostnames when
picking one.
2014-08-11 15:06:22 +02:00
Lennart Poettering 902bb5d8ab resolved: verify all RRs when we come back from suspend 2014-08-11 15:06:22 +02:00
Lennart Poettering a407657425 resolved: implement full LLMNR conflict detection logic 2014-08-11 15:06:22 +02:00
Lennart Poettering 21d73c87b0 resolved: actually read the initial state data from networkd when we initialize 2014-08-04 23:08:49 +02:00
Lennart Poettering f0e1546763 resolved: fix order in which we destroy manager resources 2014-08-04 19:59:05 +02:00
Lennart Poettering edc501d467 resolved: when there's already somebody listening on the LLMNR ports, simple disable LLMNR and warn, but continue
This allows us to run resolved inside an nspawn container that shares
the network namespace with the host, if there's already an instance
running.
2014-08-04 19:48:03 +02:00
Thomas Hindoe Paaboel Andersen e850d8e1ac resolved: remove unused variables 2014-08-03 13:19:19 +02:00
Lennart Poettering 2c27fbca2d resolved: flush cache each time we change to a different DNS server 2014-08-01 18:10:01 +02:00
Lennart Poettering 5cb36f41f0 resolved: read the system /etc/resolv.conf unless we wrote it ourselves
This way we integrate nicely with foreign network management stacks,
such as NM.
2014-08-01 18:10:01 +02:00
Lennart Poettering 39d8db043b resolved: rename resolved.h to resolved-manager.h
After all it pretty much exlcusively containers definitions about the
"Manager" object, hence let's call this the most obvious way.
2014-08-01 16:14:59 +02:00
Lennart Poettering 4e945a6f79 resolved: beef up DNS server configuration logic
We now maintain two lists of DNS servers: system servers and fallback
servers.

system servers are used in combination with any per-link servers.

fallback servers are only used if there are no system servers or
per-link servers configured.

The system server list is supposed to be populated from a foreign tool's
/etc/resolv.conf (not implemented yet).

Also adds a configuration switch for LLMNR, that allows configuring
whether LLMNR shall be used simply for resolving or also for responding.
2014-08-01 16:06:39 +02:00
Lennart Poettering eb60f9cd4e hostnamed: watch system hostname changes and update LLMNR RRs accordingly 2014-07-31 19:54:43 +02:00
Lennart Poettering ec2c5e4398 resolved: implement LLMNR uniqueness verification 2014-07-31 17:47:19 +02:00
Zbigniew Jędrzejewski-Szmek b2fadec604 Properly report invalid quoted strings
$ systemd-analyze verify trailing-g.service
[./trailing-g.service:2] Trailing garbage, ignoring.
trailing-g.service lacks ExecStart setting. Refusing.
Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument.
Failed to create trailing-g.service/start: Invalid argument
2014-07-31 08:56:03 -04:00
Zbigniew Jędrzejewski-Szmek a2a5291b3f Reject invalid quoted strings
String which ended in an unfinished quote were accepted, potentially
with bad memory accesses.

Reject anything which ends in a unfished quote, or contains
non-whitespace characters right after the closing quote.

_FOREACH_WORD now returns the invalid character in *state. But this return
value is not checked anywhere yet.

Also, make 'word' and 'state' variables const pointers, and rename 'w'
to 'word' in various places. Things are easier to read if the same name
is used consistently.

mbiebl_> am I correct that something like this doesn't work
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"'
mbiebl_> systemd seems to strip of the quotes
mbiebl_> systemctl status shows
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS  $RootDir $MountPoint
mbiebl_> which is pretty weird
2014-07-31 04:00:31 -04:00
Lennart Poettering a2a416f768 resolved: add more debug logging 2014-07-29 23:53:08 +02:00
Lennart Poettering bf3f1271e2 resolved: set LLMNR TCP and UDP TTLs to the values suggested by the RFC 2014-07-29 23:53:08 +02:00
Lennart Poettering 623a4c97b9 resolve: add llmnr responder side for UDP and TCP
Name defending is still missing.
2014-07-29 20:57:58 +02:00
Tom Gundersen 6073b6f26a resolved: don't read DHCP leases
networkd will expose both statically configured DNS servers and servers
receieved over DHCP in sd_network_get_dns(), so no need to keep
the distinction in resolved.
2014-07-23 23:54:52 +02:00
Lennart Poettering faa133f3aa resolved: rework logic so that we can share transactions between queries of different clients 2014-07-23 02:00:40 +02:00
Lennart Poettering 0dd25fb9f0 change type for address family to "int"
Let's settle on a single type for all address family values, even if
UNIX is very inconsitent on the precise type otherwise. Given that
socket() is the primary entrypoint for the sockets API, and that uses
"int", and "int" is relatively simple and generic, we settle on "int"
for this.
2014-07-18 16:10:51 +02:00
Lennart Poettering 1716f6dcf5 resolved: add LLMNR support for looking up names 2014-07-18 12:38:32 +02:00
Lennart Poettering e1c959948c resolved: properly handle MTU logic 2014-07-17 01:41:52 +02:00
Lennart Poettering 0014a4ad50 sd-network: fix parameter order for sd_network_monitor_new()
Constructors should return the object they created as first parameter,
except when they are generated as a child/member object of some other
object in which case that should be first.
2014-07-17 01:41:52 +02:00
Zbigniew Jędrzejewski-Szmek 36f822c4bd Let config_parse open file where applicable
Special care is needed so that we get an error message if the
file failed to parse, but not when it is missing. To avoid duplicating
the same error check in every caller, add an additional 'warn' boolean
to tell config_parse whether a message should be issued.
This makes things both shorter and more robust wrt. to error reporting.
2014-07-16 18:47:20 -04:00
Lennart Poettering ad86766293 resolved: support for TCP DNS queries 2014-07-16 20:15:47 +02:00
Lennart Poettering 3cb10d3a0b dns-domain: introduce macros for accessing all DNS header fields 2014-07-16 18:03:46 +02:00
Zbigniew Jędrzejewski-Szmek e9f3d2d508 Constify ConfigTableItem tables 2014-07-15 22:34:40 -04:00
Lennart Poettering 74b2466e14 resolved: add a DNS client stub resolver
Let's turn resolved into a something truly useful: a fully asynchronous
DNS stub resolver that subscribes to network changes.

(More to come: caching, LLMNR, mDNS/DNS-SD, DNSSEC, IDN, NSS module)
2014-07-16 00:31:38 +02:00
Lennart Poettering 096b677388 resolved: properly free network monitor 2014-07-10 20:12:34 +02:00
Lennart Poettering c92e531c82 resolved: make use of union in_addr_union in resolved, too 2014-07-07 23:11:48 +02:00
Lennart Poettering 987d561fe2 resolved: let config_parse() open the configuration file for us 2014-07-07 23:03:17 +02:00
Tom Gundersen b686acb27e resolved: move resolv.conf to resolved's runtime dir 2014-06-02 15:14:32 +02:00
Tom Gundersen 091a364c80 resolved: add daemon to manage resolv.conf
Also remove the equivalent functionality from networkd.
2014-05-19 18:14:56 +02:00