summaryrefslogtreecommitdiff
path: root/src/resolve
AgeCommit message (Collapse)Author
2017-02-13resolved: count the number of addresses per linkLennart Poettering
This becomes handy later on. Moreover, we keep track of similar counters for other objects like this too, hence adding this here too is obvious.
2017-02-13resolved: don't return ANY transactions when looking for transactionsLennart Poettering
This reverts a part of 53fda2bb933694c9bdb1bbf1f5583e39673b74b2: On classic DNS and LLMNR ANY requests may be replied to with any kind of RR, and the reply does not have to be comprehensive: these protocols simply define that if there's an RRset that can answer the question, then at least one should be sent as reply, but not necessarily all. This means it's not safe to "merge" transactions for arbitrary RR types into ANY requests, as the reply might not answer the specific question. As the merging is primarily an optimization, let's undo this for now. This logic may be readded later, in a way that only applies to mDNS. Also, there's an OOM problem with this chunk: dns_resource_key_new() might fail due to OOM and this is not handled. (This is easily removed though, by using DNS_RESOURCE_KEY_CONST()).
2017-02-12Merge pull request #4832 from rojkov/mdnsZbigniew Jędrzejewski-Szmek
2017-02-09resolved: if strict DNSSEC mode is selected never downgrade below DNSSEC ↵Lennart Poettering
server feature level due to packet loss Fixes: #4315
2017-02-09resolved: also synthesize records for the full local hostnameLennart Poettering
Previously, we'd only synthesize RRs for the LLMNR and mDNS versions of the hostnames (i.e. the first label of the kernel hostname, as well as the first label of the kernel hostname suffixed with .local). With this change, we also synthesize an RR for the full hostname, which is relevant in case it has more than one label. Fixes: #5041
2017-02-09resolved: when a server response with REFUSED, try a different oneLennart Poettering
Fixes: #4264
2017-02-09resolved: when following a CNAME initialize authenticated bit by the weakest ↵Lennart Poettering
answer When following a CNAME chain, don't set the authenticated bit, unless all lookups in the chain could be authenticated.
2017-02-09resolved: follow CNAMES for DNS stub repliesLennart Poettering
Clients expect us to follow CNAMEs for them, hence do so. On the first iteration start putting together a packet, and then keep adding data we acquire through CNAMEs to it, until we finally send it off. Fixes: #3826
2017-02-09tree-wide: make bus_map_all_properties return a proper sd_bus_errorLennart Poettering
And then show it, to make things a bit friendlier to the user if we fail acquiring some props. In fact, this fixes a number of actual bugs, where we used an error structure for output that we actually never got an error in.
2017-02-05resolved: downgrade "processing query..." message to debug (#5233)Felipe Sateler
It doesn't really add much value in normal operation and just spams the log.
2017-02-02fs-util: unify code we use to check if dirent's d_name is "." or ".."Lennart Poettering
We use different idioms at different places. Let's replace this is the one true new idiom, that is even a bit faster...
2017-01-24resolve: fix strv memleakZbigniew Jędrzejewski-Szmek
sd_bus_message_read_strv() returns a normal strv...
2017-01-19resolve: Add support for mDNS to systemd-resolve utilityDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: actually enable mDNS supportDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: implement sending goodbye mDNS packetDmitry Rozhkov
resolved: remove unneeded braces Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: add cache-flush bit to answers in mDNS announcementsDmitry Rozhkov
See the section 10.2 of RFC6762 for details. Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: implement mDNS probing and announcementDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: process mDNS queriesDmitry Rozhkov
This way other hosts can resolve our hostname to its address using mDNS. Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: set multicast membership for mDNS socketsDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: set description to correct event sourceDmitry Rozhkov
Otherwise we fail an assertion down the path since t->timeout_event_source is NULL and it's the "other" transaction that's supposed to have the event source. Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: populate mDNS scopes' zones with RRs for the hostDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: adhere to RFC when handling mDNS goodbye packetsDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: ignore mDNS multicast packets originated from our hostDmitry Rozhkov
By default all sent multicast packets are looped back to the sending host. And since the code that adds the mDNS socket to the mDNS multicast group is the same as for LLMNR I decided that for now it'd be safer to filter looped back packets in the application than to switch loopback off. Because I don't know what would be the implications for LLMNR with loopback switched off. I suspect that loopback can be disabled for LLMNR safely too and the function manager_our_packet() is not really needed. But I'd prefer to do it in another patchset. Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: fix typo in warning messageDmitry Rozhkov
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19resolved: install answers to mDNS transactions tooDmitry Rozhkov
Currently resolving mDNS requests doesn't work because in dns_transaction_process_reply() no answer gets installed into mDNS transactions. When receiving a mDNS reply we should not check for query section equivalence of the request and its corresponsing response. But still we need to install answers to mDNS transactions to make it possible to actually resolve mDNS requests. Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-10build-sys: add check for gperf lookup function signature (#5055)Mike Gilbert
gperf-3.1 generates lookup functions that take a size_t length parameter instead of unsigned int. Test for this at configure time. Fixes: https://github.com/systemd/systemd/issues/5039
2016-12-22resolved: correctly handle non-address RR types with /etc/hosts lookups (#4808)Martin Pitt
Fix wrong condition test in manager_etc_hosts_lookup(), which caused it to return an IPv4 answer when an IPv6 question was asked, and vice versa. Also only return success if we actually found any A or AAAA record. In systemd-resolved.service(8), point out that /etc/hosts mappings only affect address-type lookups, not other types. The test case currently disables DNSSEC in resolved, as there is a bug where "-t MX" fails due to "DNSSEC validation failed" even after "downgrading to non-DNSSEC mode". This should be dropped once that bug gets fixed. Fixes #4801
2016-12-06core: introduce parse_ip_port (#4825)Susant Sahani
1. Listed in TODO. 2. Tree wide replace safe_atou16 with parse_ip_port incase it's used for ports.
2016-12-02treewide: fix typos (#4802)Torstein Husebø
2016-11-11tree-wide: make invocations of extract_first_word more uniform (#4627)Zbigniew Jędrzejewski-Szmek
extract_first_words deals fine with the string being NULL, so drop the upfront check for that.
2016-11-10resolved: unlink private resolv.conf on exitChristian Hesse
This fixes the logic with systemd-nspawn which checks for private resov.conf to decide whether or not to mount it into the container.
2016-11-10resolved: use macro for private resolve.confChristian Hesse
Use the macro from header file to have a single definition of the path.
2016-11-03Merge pull request #4510 from keszybz/tree-wide-cleanupsLennart Poettering
Tree wide cleanups
2016-10-24resolved: properly check for the root domainLennart Poettering
Fix-up for #4164
2016-10-23tree-wide: drop NULL sentinel from strjoinZbigniew Jędrzejewski-Szmek
This makes strjoin and strjoina more similar and avoids the useless final argument. spatch -I . -I ./src -I ./src/basic -I ./src/basic -I ./src/shared -I ./src/shared -I ./src/network -I ./src/locale -I ./src/login -I ./src/journal -I ./src/journal -I ./src/timedate -I ./src/timesync -I ./src/nspawn -I ./src/resolve -I ./src/resolve -I ./src/systemd -I ./src/core -I ./src/core -I ./src/libudev -I ./src/udev -I ./src/udev/net -I ./src/udev -I ./src/libsystemd/sd-bus -I ./src/libsystemd/sd-event -I ./src/libsystemd/sd-login -I ./src/libsystemd/sd-netlink -I ./src/libsystemd/sd-network -I ./src/libsystemd/sd-hwdb -I ./src/libsystemd/sd-device -I ./src/libsystemd/sd-id128 -I ./src/libsystemd-network --sp-file coccinelle/strjoin.cocci --in-place $(git ls-files src/*.c) git grep -e '\bstrjoin\b.*NULL' -l|xargs sed -i -r 's/strjoin\((.*), NULL\)/strjoin(\1)/' This might have missed a few cases (spatch has a really hard time dealing with _cleanup_ macros), but that's no big issue, they can always be fixed later.
2016-10-16tree-wide: use mfree moreZbigniew Jędrzejewski-Szmek
2016-10-11resolve: remove unsed counter (#4349)Thomas H. P. Andersen
It was introduced but never used in 45ec7efb.
2016-10-10resolved: initialize variable (#4338)Thomas H. P. Andersen
r was not initialized and would be used if "tcp" was the only option used for the stub. We should initialize it to 0 to indicate that no error happened in the udp case.
2016-10-09resolved: also disable stub listener on EPERMZbigniew Jędrzejewski-Szmek
When running in a user namespace without private networking, resolved would fail to start. There isn't much difference between EADDRINUSE and EPERM, so treat them the same, except for the warning message text.
2016-10-09resolved: simplify error handling in manager_dns_stub_{udp,tcp}_fd()Zbigniew Jędrzejewski-Szmek
Make sure an error is always printed… When systemd-resolved is started in a user namespace without private network, it would fail on setsockopt, but the error wouldn't be particularly informative: "Failed to start manager: permission denied."
2016-10-08systemd-resolve: use sha256 for local-part of openpgp key (#4193)Stefan Schweter
2016-10-07Merge pull request #4061 from dm0-/coreos-1545Lennart Poettering
resolved: add an option to disable the stub resolver
2016-10-07resolved: add an option to control the DNS stub listenerDavid Michael
2016-10-06tree-wide: drop some misleading compiler warningsLennart Poettering
gcc at some optimization levels thinks thes variables were used without initialization. it's wrong, but let's make the message go anyway.
2016-10-06resolved: properly handle BADCOOKIE DNS errorLennart Poettering
Add this new error code (documented in RFC7873) to our list of known errors.
2016-09-30resolved: don't query domain-limited DNS servers for other domains (#3621)Martin Pitt
DNS servers which have route-only domains should only be used for the specified domains. Routing queries about other domains there is a privacy violation, prone to fail (as that DNS server was not meant to be used for other domains), and puts unnecessary load onto that server. Introduce a new helper function dns_server_limited_domains() that checks if the DNS server should only be used for some selected domains, i. e. has some route-only domains without "~.". Use that when determining whether to query it in the scope, and when writing resolv.conf. Extend the test_route_only_dns() case to ensure that the DNS server limited to ~company does not appear in resolv.conf. Add test_route_only_dns_all_domains() to ensure that a server that also has ~. does appear in resolv.conf as global name server. These reproduce #3420. Add a new test_resolved_domain_restricted_dns() test case that verifies that domain-limited DNS servers are only being used for those domains. This reproduces #3421. Clarify what a "routing domain" is in the manpage. Fixes #3420 Fixes #3421
2016-09-16tree-wide: rename config_parse_many to …_nulstrZbigniew Jędrzejewski-Szmek
In preparation for adding a version which takes a strv.
2016-08-31resolved: directly include some required headers instead of inheritingDavid Michael
2016-08-31resolved: remove unused prototypeDavid Michael
2016-08-31resolved: include d.f.ip6.arpa in default NTA listLennart Poettering
Fixes: #4049