Commit graph

49 commits

Author SHA1 Message Date
Tom Gundersen 8300ba218e 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.
2015-07-14 18:50:53 +02:00
Tom Gundersen a0166609f7 resolved: packet - ensure there is space for IP+UDP headers
Currently we only make sure our links can handle the size of the payload witohut
taking the headers into account.
2015-07-14 12:03:04 +02:00
Daniel Mack 8b757a3861 resolved: separate LLMNR specific header bits
The C and T bits in the DNS packet header definitions are specific to LLMNR.
In regular DNS, they are called AA and RD instead. Reflect that by calling
the macros accordingly, and alias LLMNR specific macros.

While at it, define RA, AD and CD getters as well.
2015-07-13 11:28:29 -04:00
Daniel Mack 22a37591ed resolved: use a #define for LLMNR port
De-duplicate some magic numbers.
2015-07-13 11:28:29 -04:00
Daniel Mack 5f402ae84b resolved: move LLMNR related functions into separate file 2015-07-13 11:28:29 -04:00
Nick Owens 4ad7f2761d resolve: move dns routines into shared 2015-06-10 11:15:45 -07:00
Lennart Poettering 958b66ea16 util: split all hostname related calls into hostname-util.c 2015-05-18 17:10:07 +02:00
Ronny Chevalier 3df3e884ae shared: add random-util.[ch] 2015-04-11 00:11:13 +02:00
Zbigniew Jędrzejewski-Szmek dc75168823 Use space after a silencing (void)
We were using a space more often than not, and this way is
codified in CODING_STYLE.
2015-03-13 23:42:17 -04:00
David Herrmann 15411c0cb1 tree-wide: there is no ENOTSUP on linux
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
2015-03-13 14:10:39 +01:00
Torstein Husebø d076c6f9e4 networkd/resolved: correct spacing near eol in code comments 2014-12-11 15:04:43 +01:00
Lennart Poettering 77209c3505 resolved: don't resolve the hostname "gateway" with LLMNR, leave that to nss-myhostname 2014-12-03 22:23:41 +01:00
Michal Schmidt f647962d64 treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
 'local $/;
  local $_=<>;
  s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
  print;'
 $f
done

And a couple of manual whitespace fixups.
2014-11-28 18:56:16 +01:00
Michal Schmidt da927ba997 treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
2014-11-28 13:29:21 +01:00
Michal Schmidt 0a1beeb642 treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:

find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'

Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().
2014-11-28 12:04:41 +01:00
Susant Sahani 0c9eefb7e3 resolve: fix CID#1237549 Unchecked return value 2014-11-17 10:58:55 +01:00
Michal Schmidt 1e43061b67 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.
2014-10-23 17:38:02 +02:00
Michal Schmidt d5099efc47 hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.

systemd keeps hundreds of hashmaps, so this saves a little bit of
memory.
2014-09-15 16:08:50 +02:00
Lennart Poettering 4de120ee44 resolved: fix assertion when joining llmnr mcast group 2014-08-15 16:42:14 +02:00
Lennart Poettering 5ba73e9b64 resolved: clarify that LLMNR scopes must have a link assigned
This is supposed to remove some compiler warnings:

http://lists.freedesktop.org/archives/systemd-devel/2014-July/021393.html
2014-08-14 19:56:22 +02:00
Lennart Poettering 51323288fc resolved: allow passing on which protocol, family and interface to look something up
Also, return on which protocol/family/interface we found something.
2014-08-14 01:01:43 +02:00
Lennart Poettering a407657425 resolved: implement full LLMNR conflict detection logic 2014-08-11 15:06:22 +02:00
Lennart Poettering 6e06847294 resolved: add 100ms initial jitter to all LLMNR requests 2014-08-05 17:02:46 +02:00
Lennart Poettering aea2429d6e resolved: enforce ratelimit on LLMNR traffic 2014-08-05 17:02:46 +02:00
Lennart Poettering dc4d47e2c7 resolved: never reuse transactions for probing that are already completed based on cached data 2014-08-05 01:52:25 +02:00
Thomas Hindoe Paaboel Andersen 75cd513ef8 resolved: avoid possible dereference of null pointer
In dns_scope_make_reply_packet the structs q, answer, and soa can be
null. We should check for null before reading their fields.
2014-08-03 23:01:57 +02:00
Lennart Poettering 7b4c2ee75f resolved: always drop multicast membership before adding one
This is apparently necessary on some devices, such as veth.
2014-08-01 20:27:27 +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 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 ec2c5e4398 resolved: implement LLMNR uniqueness verification 2014-07-31 17:47:19 +02:00
Lennart Poettering fcf57f9cf7 resolved: don't attempt to order empty answer array 2014-07-30 19:24:13 +02:00
Lennart Poettering 8bf52d3d17 resolved: include SOA records in LLMNR replies for non-existing RRs to allow negative caching 2014-07-30 16:47:21 +02:00
Lennart Poettering af93291cc4 resolved: when answer A or AAAA questions, order responses by whether addresses are link-local or not 2014-07-30 00:48:59 +02:00
Lennart Poettering 2442b93d15 resolved: the llmnr destination address check applies to queries, not to responses 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 ea917db9e6 resolved: discard more invalid llmnr messages 2014-07-29 20:57:58 +02:00
Lennart Poettering b914e211f3 resolved: when resolving an address PTR record via llmnr, make a tcp connection by default 2014-07-29 20:57:58 +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
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
Zbigniew Jędrzejewski-Szmek 901fd81647 resolved: do not use unitialized variable 2014-07-18 21:44:34 -04:00
Lennart Poettering 46f08bea4b in-addr-util: remove family_to_string() API
we already have a more complete one with af_to_name(), that is generated
from the header files, no need to duplicate this.
2014-07-18 16:15:12 +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 322345fdb9 resolved: add DNS cache 2014-07-17 19:39:50 +02:00
Lennart Poettering b45d9e86e4 resolved: fix check for mdns names 2014-07-17 01:41:52 +02:00
Lennart Poettering faec72d5de resolved: we are never authoritative for localhost 2014-07-17 01:41:52 +02:00
Lennart Poettering e1c959948c resolved: properly handle MTU logic 2014-07-17 01:41:52 +02:00
Lennart Poettering ad86766293 resolved: support for TCP DNS queries 2014-07-16 20:15:47 +02: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