summaryrefslogtreecommitdiff
path: root/sbin/unwind
AgeCommit message (Collapse)Author
2019-11-28show median RTT in unwindctl statusFlorian Obser
2019-11-28Track all elements of a forwarder configuration individually:Florian Obser
IP address, port and authentication name. This makes print_config less awkward and fixes a bug were an alternative port number was not printed.
2019-11-27Instead of only considering if a resolving strategy is dead, works orFlorian Obser
validates, measure how well it is doing. We keep track of the round trip median time of past queries and sort strategies according to this in addition to the more basic qualities of does it resolve and does it validate. If a query is not answered within the median time the next best strategy gets a chance. The most prefered strategy (either from the config file or defaults) gets an additional head start of 200ms. A response of SERVFAIL also advances to the next best strategy. This is helpful when the picked strategy can only see parts of the internet but another strategy can reach more. This alone gets us past quite a few captive portals already. Additionally we doubt NXDOMAIN from anything but the stub resolver for the first 5 minutes after a network change. This is probably as good as the http check we had previously but more tests are needed. This was inspired by RFC 8305, "Happy Eyeballs". OK otto
2019-11-27Move resolver preference storage to a struct which makes it easier toFlorian Obser
reuse in the future. OK otto
2019-11-27Nuke http captive portal detection; something better is coming.Florian Obser
OK otto
2019-11-26Improve previouskn
Avoid an extra parameter and set NULL initialised conffile conditionally. From Matthew Martin <phy1729 at gmail dot com>, thanks!
2019-11-26Fail on nonexistent config file iff -c is givenkn
Default /etc/unwind.conf is optional and may be missing, but explicitly specified files should exist. OK florian
2019-11-25simplify histogram code and cut off at < limit, as the histogram display inOtto Moerbeek
unwindctl suggests; ok florian@
2019-11-25 Signal what happened, not what needs doing.Florian Obser
The frontend doesn't know.
2019-11-23plug memory leakFlorian Obser
2019-11-23An if_index of zero signals to remove all previous proposals from aFlorian Obser
daemon. Soon to be used by slaacd(8) which handles all interfaces but can't know which interfaces had been set to autoconf before a restart.
2019-11-22Use a table for unbound options; ok florian@Otto Moerbeek
2019-11-22Treat DNS proposals as replacement of previous proposals from the sameFlorian Obser
daemon and interface. An empty list is automatically a withdrawl. prodding deraadt@
2019-11-21 Track on which interface nameservers have been learned.Florian Obser
prodding deraadt@
2019-11-20Check for a too short answer packet in all callback functions becauseFlorian Obser
otherwise we try to parse an invalid packet. This can be triggered by captive_portal_resolve_done() when dhcp provided nameservers do not answer and asr hits a timeout. answer_packet is NULL and answer_len -1 in that case. Found the hard way by claudio
2019-11-19Print learned forwarders in unwindctl.Florian Obser
Someone please make this pretty. Tested by deraadt as part of a larger diff.
2019-11-19Proposals from dhclient are sometimes replacements.Florian Obser
slaacd should be changed as well. Tested by deraadt as part of a larger diff.
2019-11-19Stop dhcp lease file parsing now that dhclient sends proposals.Florian Obser
Tested by deraadt as part of a larger diff.
2019-11-15Improve readability by using a typedef for the callback type; ok florian@Otto Moerbeek
2019-11-14With the stub resolver we have since some time we can resolve theFlorian Obser
captive portal host internaly via the resolver process. deraadt and me observed weird captive portal checking hangs inside of unwind if only 127.0.0.1 was listed as a nameserver in resolv.conf with the old code.
2019-11-14 Checking a resolver that we are already checking can lead to aFlorian Obser
self-DoS under high query rate and constant failures.
2019-11-14 Since resolve() switched to a callback mechanism all uw_resolver objectsFlorian Obser
pass through resolve() and either asr_resolve_done() or ub_resolve_done(). With that we can pull resolver_ref() and resolver_unref() into those functions to make the reference counting easier. Only check_resolver is special since it needs to refcount the to be checked resolver. But the resolver doing the actual work is automatically refcounted by resolve() and *_resolve_done(). One last piece of the puzzle is to track the uw_resolver object in cb_data so that the *_resolve_done() functions have access to it. This also allowes us to remove the ad-hoc passing of the resolver in query_imsg. Since the callback functions all need access to the resolver that did the work we pass it in as first argument. OK otto
2019-11-12we might not have a best resolver at allFlorian Obser
2019-11-12do not leak buf or region if either fails to allocateFlorian Obser
2019-11-12we are not using was_ratelimitedFlorian Obser
2019-11-12Pass in a callback function to resolve() instead of a flag toFlorian Obser
distinguish between an external query and check_resolver(). Also switch trust_anchor_resolve() over which was special.
2019-11-12 Error logging is done inside of resolve since it depends on theFlorian Obser
resolver type.
2019-11-12 It is possible to cancel libunbound queries by tracking an id.Florian Obser
We are not using that feature so stop tracking the value.
2019-11-11Implement DNS proposals to learn nameservers from networkFlorian Obser
autoconfiguration daemons. Currently only slaacd is switched over so we need to keep the lease file parsing.
2019-11-10Consistently use _rcctl enable foo_ in examples, it's simpler and lessLandry Breuil
error prone than manually editing rc.conf.local, and also works to enable ipsec and accounting. tweak from schwarze@ to use the \(dq\(dq syntax for quotes in '.Dl foo_flags="" lines' instead of \&"\&". while at it, fix a reference to a bogus /dev/dhclient.conf file that recently snuck in. ok jmc@ deraadt@ schwarze@
2019-11-09Mechanically change the forwarder SIMPLEQ to a TAILQ. Needed forFlorian Obser
future work to be able to easily delete elements while iterating. OK kn
2019-11-09failure to allocate memory is not an XXXFlorian Obser
2019-11-07Document the new home of the control socket; ok florian@Otto Moerbeek
2019-11-06useless debug outputFlorian Obser
2019-11-06Move control socket to /dev like slaacd(8) is doing to be able toFlorian Obser
start unwind earlier, before /var is mounted. discussed with deraadt
2019-11-06Rename "asr" to "stub" in user visible parts.Florian Obser
More people know what a "stub" resolver is then asr. Pointed out by & discussed with deraadt Input & OK otto
2019-11-03 When we are talking to an upstream nameserver we should not refuse toFlorian Obser
forward queries for certain reverse zones (e.g. RFC1918 space). The local network might use them and it's the policy of the upstream nameserver what should be done with these. Of course if we are recursively resolving ourselves these should not leak to the global internet so we continue to synthesize NXDOMAIN ourselves. For now we also always synthesize NXDOMAIN for special use domains like test and onion. Pointed out by henning. Input & OK sthen
2019-11-03*** empty log message ***Otto Moerbeek
2019-11-02unused globalFlorian Obser
2019-11-02When we are behind a captive portal we very likely need to use the asrFlorian Obser
strategy to get past it. This is also true when we don't know yet if we are behind a captive portal. However, when the nameserver dhcp hands us are unreachable (e.g. because they are down) asr is dead, we are still using it and we are now stuck. Only force to asr if we know that it is working. If we are behind a captive portal and the dhcp nameserver are dead we probably won't get past it. But if we are in a network with unreachable dhcp nameservers we will make progress. Stumbled upon by remi while blocking port 53 in pf. OK remi
2019-10-31 With the asr fallback we can skip the service port up & down dance,Florian Obser
unwind should now be able to work in networks with crappy middle boxes. We also need to switch to the ASR resolver, not DHCP when we are behind a captive portal. Some captive portals let through DNS queries with edns0 options but the "click here to accept the terms of service page" is not resolvable with edns0.
2019-10-31Add asr resolver type which completely bypasses libunbound and uses theFlorian Obser
libc asynchronous resolver directly with DHCP provided nameservers. This is a last-ditch effort when we find ourself behind a completely broken middle-box. Input & OK otto OK benno
2019-10-21Optionally log blocked queries when using the block list.Florian Obser
OK benno
2019-10-19Plug mem leak when the list of dhcp resolvers didn't change. ok florian@Otto Moerbeek
2019-10-18Plug mem leak in error path; ok florian@ who also spotted the rad caseOtto Moerbeek
2019-10-18Another case of using yacc effectively to avoid repeating code; ok florian@Otto Moerbeek
2019-10-18Reafctor forwarder clause to avoid having to write out the same codeOtto Moerbeek
a couple of times by declaring optional stuff the proper way. ok @florian
2019-10-12handle version.bind / version.serverFlorian Obser
2019-10-12Carry the answer in the pending_query struct. Makes it clearer who isFlorian Obser
responsible for freeing allocated memory.
2019-10-12Be more strict with which queries to accept. Modeled afterFlorian Obser
worker_handle_request() in unbound(8).