b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
011696f76233486bc56c266b18a328924f70269c |
|
01-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
resolved: rework what ResolveHostname() with family == AF_UNSPEC means
Previously, if a hostanem is resolved with AF_UNSPEC specified, this would be used as indication to resolve both an
AF_INET and an AF_INET6 address. With this change this logic is altered: an AF_INET address is only resolved if there's
actually a routable IPv4 address on the specific interface, and similar an AF_INET6 address is only resolved if there's
a routable IPv6 address. With this in place, it's ensured that the returned data is actually connectable by
applications. This logic mimics glibc's resolver behaviour.
Note that if the client asks explicitly for AF_INET or AF_INET6 it will get what it asked for.
This also simplifies the logic how it is determined whether a specific lookup shall take place on a scope.
Specifically, the checks with dns_scope_good_key() are now moved out of the transaction code and into the query code,
so that we don't even create a transaction object on a specific scope if we cannot execute the resolution on it anyway. |
edbcc1fdd94355c5cf22263ba2c1cfa4ec2eb010 |
|
25-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
resolve: generate a nice clean error when clients try to resolve a name when the network is down |
519ef04651b07a547f010d6462603669d7fde4e5 |
|
27-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: rework OPT RR generation logic
This moves management of the OPT RR out of the scope management and into
the server and packet management. There are now explicit calls for
appending and truncating the OPT RR from a packet
(dns_packet_append_opt() and dns_packet_truncate_opt()) as well as a
call to do the right thing depending on a DnsServer's feature level
(dns_server_adjust_opt()).
This also unifies the code to pick a server between the TCP and UDP code
paths, and makes sure the feature level used for the transaction is
selected at the time the server is picked, and not changed until the
next time we pick a server. The server selction code is now unified in
dns_transaction_pick_server().
This all fixes problems when changing between UDP and TCP communication
for the same server, and makes sure the UDP and TCP codepaths are more
alike. It also makes sure we never keep the UDP port open when switchung
to TCP, so that we don't have to handle incoming datagrams on the latter
we don't expect.
As the new code picks the DNS server at the time we make a connection,
we don't need to invalidate the DNS server anymore when changing to the
next one, thus dns_transaction_next_dns_server() has been removed. |
49cce12d4a07a77c6321b743e538c648d33c037c |
|
26-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: name TCP and UDP socket calls uniformly
Previously the calls for emitting DNS UDP packets were just called
dns_{transacion|scope}_emit(), but the one to establish a DNS TCP
connection was called dns_transaction_open_tcp(). Clean this up, and
rename them dns_{transaction|scope}_emit_udp() and
dns_transaction_open_tcp(). |
0db4c90afd7d9c7c8884bf8b3ec459edc74a03da |
|
08-Dec-2015 |
Daniel Mack <daniel@zonque.org> |
resolved: add code to join/leave mDNS multicast groups
Per link, join the mDNS multicast groups when the scope is created, and
leave it again when the scope goes away. |
24710c48ed16be5fa461fbb303a744a907541daf |
|
03-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: introduce a dnssec_mode setting per scope
The setting controls which kind of DNSSEC validation is done: none at
all, trusting the AD bit, or client-side validation.
For now, no validation is implemented, hence the setting doesn't do much
yet, except of toggling the CD bit in the generated messages if full
client-side validation is requested. |
28b9b7640603f88cb49f95609331fa5072715f15 |
|
03-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: rework how we allow allow queries to be dispatched to scopes
Previously, we'd never do any single-label or root domain lookups via
DNS, thus leaving single-label lookups to LLMNR and the search path
logic in order that single-label names don't leak too easily onto the
internet. With this change we open things up a bit, and only prohibit
A/AAAA lookups of single-label/root domains, but allow all other
lookups. This should provide similar protection, but allow us to resolve
DNSKEY+DS RRs for the top-level and root domains.
(This also simplifies handling of the search domain detection, and gets
rid of dns_scope_has_search_domains() in favour of
dns_scope_get_search_domains()). |
9c5e12a4314e7192e834e1b855e5e80111e636a6 |
|
27-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
resolved: implement minimal EDNS0 support
This is a minimal implementation of RFC6891. Only default values
are used, so in reality this will be a noop.
EDNS0 support is dependent on the current server's feature level,
so appending the OPT pseudo RR is done when the packet is emitted,
rather than when it is assembled. To handle different feature
levels on retransmission, we strip off the OPT RR again after
sending the packet.
Similarly, to how we fall back to TCP if UDP fails, we fall back
to plain UDP if EDNS0 fails (but if EDNS0 ever succeeded we never
fall back again, and after a timeout we will retry EDNS0). |
f9ebb22ab4758bc5bbaaf8eeead74b5b4f81d5c3 |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: handle properly if there are multiple transactions for the same key per scope
When the zone probing code looks for a transaction to reuse it will
refuse to look at transactions that have been answered from cache or the
zone itself, but insist on the network. This has the effect that there
might be multiple transactions around for the same key on the same
scope. Previously we'd track all transactions in a hashmap, indexed by
the key, which implied that there would be only one transaction per key,
per scope. With this change the hashmap will only store the most recent
transaction per key, and a linked list will be used to track all
transactions per scope, allowing multiple per-key per-scope.
Note that the linked list fields for this actually already existed in
the DnsTransaction structure, but were previously unused. |
dc477e7385e8ab29efb8fadb72ec994077a105c6 |
|
25-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
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(). |
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47dd |
|
25-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
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 |
a51c10485af349eb15faa4d1a63b9818bcf3e589 |
|
25-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
71d35b6b5563817dfbe757ab9e3b9f018b2db491 |
|
18-Nov-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: sort includes in *.h
This is a continuation of the previous include sort patch, which
only sorted for .c files. |
4d506d6bb757af3b99e0876234c465e6898c5ea4 |
|
26-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: dump cache and zone contents to syslog on SIGUSR1 |
da0c630e141e3c3fab633a1c7a0686295e2c9411 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: replace transaction list by hashmap
Right now we keep track of ongoing transactions in a linked listed for
each scope. Replace this by a hashmap that is indexed by the RR key.
Given that all ongoing transactions will be placed in pretty much the
same scopes usually this should optimize behaviour.
We used to require a list here, since we wanted to do "superset" query
checks, but this became obsolete since transactions are now single-key
instead of multi-key. |
f52e61da047d7fc74e83f12dbbf87e0cbcc51c73 |
|
21-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
resolved: only maintain one question RR key per transaction
Let's simplify things and only maintain a single RR key per transaction
object, instead of a full DnsQuestion. Unicast DNS and LLMNR don't
support multiple questions per packet anway, and Multicast DNS suggests
coalescing questions beyond a single dns query, across the whole system. |
9df3ba6c6cb65eecec06f39dfe85a3596cedac4e |
|
03-Aug-2015 |
Tom Gundersen <teg@jklm.no> |
resolved: transaction - exponentially increase retry timeouts
Rather than fixing this to 5s for unicast DNS and 1s for LLMNR, start
at a tenth of those values and increase exponentially until the old
values are reached. For LLMNR the recommended timeout for IEEE802
networks (which basically means all of the ones we care about) is 100ms,
so that should be uncontroversial. For unicast DNS I have found no
recommended value. However, it seems vastly more likely that hitting a
500ms timeout is casued by a packet loss, rather than the RTT genuinely
being greater than 500ms, so taking this as a startnig value seems
reasonable to me.
In the common case this greatly reduces the latency due to normal packet
loss. Moreover, once we get support for probing for features, this means
that we can send more packets before degrading the feature level whilst
still allowing us to settle on the correct feature level in a reasonable
timeframe.
The timeouts are tracked per server (or per scope for the multicast
protocols), and once a server (or scope) receives a successfull package
the timeout is reset. We also track the largest RTT for the given
server/scope, and always start our timouts at twice the largest
observed RTT. |
471d40d92fc8e7b452dff99a156f9e0b520ded20 |
|
27-Jul-2015 |
Tom Gundersen <teg@jklm.no> |
resolved: transaction - introduce dns_transaction_emit()
This function emits the UDP packet via the scope, but first it will
determine the current server (and connect to it) and store the
server in the transaction.
This should not change the behavior, but simplifies the code. |
0db643664cf37111be163c0c64ccd66b519daf34 |
|
27-Jul-2015 |
Tom Gundersen <teg@jklm.no> |
resolved: transaction - move DNS UDP socket creation to the scope
With access to the server when creating the socket, we can connect()
to the server and hence simplify message sending and receiving in
follow-up patches. |
3ea1453c42c4da445a4d4561fc22423b6bbb6d9b |
|
23-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
resolve: drop dns_scope_good_dns_server()
It's not used anymore since 29815b6c608b836cada5e349d06a96b63eaa65f3,
hence let's remove it from the sources. |
d20b1667dbab8bccf69735523a0d5fc645e81b80 |
|
14-Jul-2015 |
Tom Gundersen <teg@jklm.no> |
resolved: use one UDP socket per transaction
We used to have one global socket, use one per transaction instead. This
has the side-effect of giving us a random UDP port per transaction, and
hence increasing the entropy and making cache poisoining significantly
harder to achieve.
We still reuse the same port number for packets belonging to the same
transaction (resent packets). |
8300ba218e3cf5049496937be8bce10f22d09bbc |
|
14-Jul-2015 |
Tom Gundersen <teg@jklm.no> |
resolved: pin the server used in a transaction
We want to discover information about the server and use that in when crafting
packets to be resent. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
1e43061b67336052b5b231840a38508a5397a363 |
|
23-Oct-2014 |
Michal Schmidt <mschmidt@redhat.com> |
resolve: make DnsScope::conflict_queue an OrderedHashmap
on_conflict_dispatch() uses hashmap_steal_first() and then does
something non-trivial with it. It may care about the order. |
51323288fc628a5cac50914df915545d685b793e |
|
14-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: allow passing on which protocol, family and interface to look something up
Also, return on which protocol/family/interface we found something. |
a407657425a3e47fd2b559cd3bc800f791303f63 |
|
11-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: implement full LLMNR conflict detection logic |
aea2429d6ec32261dbf6b9caa125fcc6ea9ea76a |
|
05-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: enforce ratelimit on LLMNR traffic |
dc4d47e2c79aafa3ef646e32ff3422c4ce935c1b |
|
05-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: never reuse transactions for probing that are already completed based on cached data |
2c27fbca2d88214bd305272308a370a962818f1e |
|
01-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: flush cache each time we change to a different DNS server |
39d8db043b599a7382f94bfc904d5e108af438bd |
|
01-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
ec2c5e4398f9d65e5dfe61530f2556224733d1e6 |
|
31-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: implement LLMNR uniqueness verification |
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbf |
|
29-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
resolve: add llmnr responder side for UDP and TCP
Name defending is still missing. |
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56a |
|
18-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
1716f6dcf54d4c181c2e2558e3d5414f54c8d9ca |
|
18-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: add LLMNR support for looking up names |
322345fdb9865ef2477fba8e4bdde0e1183ef505 |
|
17-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: add DNS cache |
ad867662936a4c7ab2c7116d804c272338801231 |
|
16-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
resolved: support for TCP DNS queries |
74b2466e14a1961bf3ac0e8a60cfaceec705bd59 |
|
16-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
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) |