summaryrefslogtreecommitdiff
path: root/sbin/unwind
AgeCommit message (Collapse)Author
2021-01-19Move control_state and ctl_conns to control.c, it's not neededFlorian Obser
elsewhere and unbreaks -fno-common. Inspired by claudio Problem reported by mortimer
2021-01-19Prevent more yacc clashes; fixes -fno-common.Florian Obser
Problem reported by mortimer.
2021-01-19Reduce scope of routesock unbreaking -fno-common.Florian Obser
Problem reported by mortimer.
2021-01-19No need for a global uw_process; unbreaks -fno-common.Florian Obser
Problem reported by mortimer
2021-01-18Remove c++ comment that snuck in and remove useless debug output.Florian Obser
2021-01-12Implement listening on 53/TCPFlorian Obser
Since we are only serving localhost we could get away with doing serving over UDP only because we have a huge MTU on lo0, it's still not correct behavior. This also enables sending truncated answers with TC set if the answer does not fit into the edns announced udp size. Testing at least by matthieu, jca, otto, phessler OK phessler
2021-01-12Rewrite query parsing and answer formatting using libunbound providedFlorian Obser
functions. With this we can filter out DNSSEC RRsets if the client did not ask for them. We will also be able to send truncated answers to indicate to the client to switch to tcp. This will be enabled in the next commit. Testing at least by matthieu, jca, otto, phessler OK phessler
2021-01-06do not call log_addr() when the address is NULLanton
ok florian@
2020-12-26Update default preference listkn
OK florian
2020-12-26Otto hit an impossible situation: an answer bigger than 64k.Florian Obser
Log the query and answer SERVFAIL instead of exiting fataly. That way we can at least figure out where libunbound goes off the rail. OK otto
2020-12-11Introduce query_imsg2str() to simplify printing "qname class type".Florian Obser
OK kn some time ago
2020-12-11The recent fix to handle large answers in unwind (errata #5 for 6.8)Florian Obser
has the downside to always copy the maximum IMSG size (about 16k) between the resolver and frontend process for DNS answers because we had to keep it as simple as possible. We can now rearange things in -current to be less wasteful. This copies only the usually small DNS answer. In the unusual case that a DNS answer is larger than the maximum IMSG size fragment the message and send multiple IMSGs.
2020-12-11Warning: arithmetic on a pointer to void is a GNU extension; mergedFlorian Obser
upstream.
2020-12-11Sprinkle in some static to prevent missing prototype warnings; mergedFlorian Obser
upstream.
2020-12-11sync to libunbound 1.13.0Florian Obser
Support for channel reuse of TCP and TLS (DoT) streams should improve latency when the DoT strategy is used in unwind.
2020-11-09Use RB_FOREACH_SAFE instead of handrolling itTheo Buehler
No binary change on amd64. ok florian
2020-11-09Check for and handle duplicates on RB_INSERTTheo Buehler
If the configuration contains duplicate domains in the block list file or a force list, the nodes would leak in the frontend process each time the config is reloaded. Also add a check when copying the force list over imsg and fatal if a duplicate is encountered. This should never happen. ok florian
2020-11-09Don't leak domain when freeing block list nodesTheo Buehler
Domains contained in the block list file were not correctly freed. This would grow the frontend process by the size of the blocklist file on each config reload. ok florian
2020-11-05Handle DNS answers that are larger than the maximum imsg size (aboutFlorian Obser
16k) by splitting them up. Previously unwind would send meta-data about the finished query from the resolver process to the frontend process and then silently fail to send the actual answer because it was too big for imsg. When receiving the meta-data for the next query the frontend process would then exit via fatal() because it was still expecting an answer. This likely fixes rare crashes observed by Leo Unglaub. Note that even with DNSSEC signatures, answers this big are very rare. OK tb, benno
2020-10-29Add some documentation about the cachingsolene
done in unwind. Inputs from jmc@ florian@ ok jmc@ florian@
2020-10-28Update to libunbound 1.12.0; heavy lifting by sthenFlorian Obser
2020-10-02Plug leak of 'str': at the end of the strsep() loop it is NULL, soOtto Moerbeek
freeing it is a no-op. Leak detected by my experimental malloc leak detector. ok florian@
2020-09-12When an interface disapears we need to forget the learned autoconfFlorian Obser
resolvers. OK kn
2020-08-29Use SO_REUSEADDR on the listening socketsJeremie Courreges-Anglas
Lets unwind(8) run when another name server listens on the wildcard address. Conflict with unbound(8) spotted by sthen@, ok florian@ deraadt@
2020-08-29Missing prototype for a currently unused function.Florian Obser
Reported upstream.
2020-08-29sync to libunbound-1.11.0Florian Obser
all heavy lifting done by sthen in unbound testing benno
2020-05-25Do not log "startup" to syslog.Florian Obser
slaacd and unwind start very early in the boot process and syslog is not fully available yet so these messages tend to get lost. But they are also not particularly useful. Prompted by a report by Jason Mader on bugs@ OK deraadt, claudio, bluhm Note that this code has been copied around to all our privsep daemons and also lives in usr.sbin. Leave it alone there because multiple people said they find it useful for those daemons.
2020-05-19sync libunbound fixes from unbound, ok florian@Stuart Henderson
2020-05-10sockaddr_rtdns does not guarantee alignment of the buffer. So firstOtto Moerbeek
memcpy the address into a local var before comparing it with code that reads ints using int *. at least sparc64 and landisk suffer from this. with and ok jca@
2020-05-08Use a union to ensure cmsg buffer is properly alignedJeremie Courreges-Anglas
Fixes a crash on landisk (strict alignement arch) reported by otto@ ok deraadt@ otto@
2020-04-21unwind(8) is supposed to work in all situations, it no longerFlorian Obser
closes its service port when resolving is not working to give asr(3) a chance (because it falls back to asr(3) internally) Therefore it is ok to only list 127.0.0.1 in /etc/resolv.conf. Triggered by a question from Frantisek Holop. OK benno
2020-03-23Declare lz_enter_rr_into_zone() static, it's only used inFlorian Obser
this file. Pointed out by clang with -Wmissing-prototypes
2020-03-23Fix prototype.Florian Obser
Pointed out by clang with -Wstrict-prototypes
2020-03-23Update to libunbound 1.10.0Florian Obser
Heavy lifting by sthen in unbound(8) Tested by benno and matthieu
2020-03-19Return when create_solver() returns NULL to prevent null pointer dereferencetobhe
in 'resolvers[type]->state = state'. ok florian@
2020-01-28We are not correctly upgrading from "UNKNOWN" to "VALIDATING"Florian Obser
resulting in a "fatal in resolver: wrong unified cache set on resolver". I believe this happens because we are using an UNKNOWN resolving strategy to resolve queries. Disable the upgrade logic for now and always construct a fresh resolver context and set the unified context on it before any cache gets allocated. This causes a bit of memory churn on startup and when changing networks, but better than a crashing unwind. First observed by deraadt
2020-01-28sbin/unwind: replace TAILQ concatenation loop with TAILQ_CONCATbket
OK florian@. reads ok benno@
2020-01-20We can not share a cache between validating and resolving strategies.Florian Obser
The resolving only strategies mess up the negative cache by claiming DNSSEC related records do not exist which confuses the validating strategies. Found the hard way by kn@ and analysed by otto@ OK kn@
2019-12-23Ralph Dolmans from nlnetlabs points out that libunbound usesFlorian Obser
ub_event_pluggable.c instead of ub_event.c. ( https://github.com/NLnetLabs/unbound/issues/99 ) We have been the odd one out, so switch to ub_event_pluggable, too.
2019-12-20Try to bind to port 53 before opening the control socket.Florian Obser
The bind might fail if another daemon is running while the control socket opening will succeed. Then we end up with an overwritten control socket, unwind exiting and no control socket to the already running unwind. Found the hard way by deraadt OK deraadt, mestre, kn, pamela
2019-12-18Workaround unbound github issue #99.Florian Obser
https://github.com/NLnetLabs/unbound/issues/99 ub_ctx_delete would free the passed in event_base leading to use-after-free since libunbound never allocated the memory and unwind expects to continue using the event_base.
2019-12-18Update to libunbound 1.9.6Florian Obser
Heavy lifting by sthen with updating in-tree unbound(8).
2019-12-18Implement unwindctl status memory to show chache memory usage.Florian Obser
testing by otto & pamela as part of a larger diff
2019-12-18Rework unified cache handling to be able to unify key and neg caches.Florian Obser
testing by otto & pamela as part of a larger diff
2019-12-18Use neg and key cache from the passed in environment if initialized so thatFlorian Obser
unwind can share caches between strategies. testing by otto & pamela as part of a larger diff
2019-12-15Make this fit in 80 cols.Florian Obser
2019-12-15Allow more outgoing ports, the default 16 is pretty tight for theOtto Moerbeek
recursor. Also change strategy to not fetch addresses of nameservers pro-actively, it does not help a lot in typical unwind setups and consumes resources we would like to spend on actual resolving user queries. ok florian@
2019-12-14Be less aggressive pre-allocating memory; ok florian@Otto Moerbeek
2019-12-14Simplify resolve_done.Florian Obser
- check if this is an answer to a still running query up front, if not there is nothing more to do - get rid of the retry case, we can now just inline it - reduce indent by always calculating elapsed time for DOUBT_NXDOMAIN_SEC Triggered by, input and OK otto
2019-12-14No use to create resolvers we know are going to be dead; ok florian@Otto Moerbeek