summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2019-11-29Don't hand-roll TAILQ_CONCAT in a slow way.Florian Obser
Pointed out by & OK otto
2019-11-29While we learn how the "decaying" histogram works it's helpful to showFlorian Obser
it in unwindctl status output next to the all time histogram.
2019-11-28The happy eyeballs code computes a median to assess how well aOtto Moerbeek
resolver is doing. But circumstances can change, so decay the histogram data over time to slowly forget about that past. Uses fixed point arithmetic to avoid floating point. ok florian@
2019-11-28ks_mapblocks is gonePhilip Guenther
2019-11-28Merge host_v{4,6}() into host_ip(), simplify host()kn
Zap lots of duplicate code and unify address family specific code where possible. There's probably more to improve, but this already cuts a lot. This is the minimal version without any cosmetic fixes or logical relocations to either improve the code or sync it with pfctl, bgpd, etc. OK tobhe
2019-11-28Introduce copy_sockaddrtoipa() and set_ipmask() bits from pfctlkn
The new wrapper will be used in the upcoming diff, set_ipmask() will be called with -1. Both is in analogy to pfctl, bgpd and others where IP/host parsing has been made more AF agnostic already. copy_sockaddrtoipa() is not called copy_satoipa() to avoid confusion with IPSec terminology (SA) as suggested by tobhe. No functional change OK tobhe
2019-11-28No more example file; ok florian@Otto Moerbeek
2019-11-28Move Notify and Certreq payload handlers after the parser. Modify SA statetobhe
only when the full message was parsed successfully. ok patrick@, "that's working for me" - sthen@
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-27Fix function name in error message (zap trailing s)kn
2019-11-27use _PATH_ names for unveil if possibleTheo de Raadt
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-23 On startup withdraw all proposals for all interfaces by sending anFlorian Obser
empty proposal with if_index 0. It is possible that the set of autoconf interfaces changed between a stop -> start transition and slaacd would never withdraw nameservers for interfaces that had the autoconf flag previously but no longer after the restart.
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-22Polish logic talking to unwind.Kenneth R Westerback
ok florian@
2019-11-22Use a table for unbound options; ok florian@Otto Moerbeek
2019-11-22DNS Proposals are treated as replacements in unwind now.Florian Obser
To withdraw a proposal sent an empty list of nameservers. This one is a bit of a hack by me to keep everything in sync for now. A better version from krw is coming soon.
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-22 Merge DNS proposals coming from the same interface.Florian Obser
That way we no longer need to handle withdraws in unwind. A new proposal from a daemon on an interface is always a replacement. If nameservers expire or an interface goes away we sent an empty list of nameservers. pestering^Wprodding deraadt
2019-11-22The DNS proposal list can (soon) be empty to signal a withdraw, relaxFlorian Obser
the size constraint to allow this to pass through the kernel. Looks good to deraadt@
2019-11-22Teach route(8) about RTP_PROPOSAL_UMBClaudio Jeker
2019-11-21 We do not send lifetimes or source in DNS proposals.Florian Obser
Do not copy them to the main process.
2019-11-21output RTM_PROPOSALs more similar to other route messagesFlorian Obser
no objection krw@ who has further suggestions for improvement
2019-11-21 Track on which interface nameservers have been learned.Florian Obser
prodding deraadt@
2019-11-21Configure the default route with RTP_NONE so that the kernel assignsFlorian Obser
different priorities for wired vs. wireless interfaces for us. Gleaned from dhclient.
2019-11-20Form DNS proposals from router advertisements with a router lifetimeFlorian Obser
of zero. It just means that the router is not a default router. This is also true for prefixes, but not yet implemented. (The diff looks complicated but it's only a } moved up + reindent.)
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-19Inform unwind about DNS servers it finds in leases.Kenneth R Westerback
ok florian@
2019-11-19Make /usr maximum 6G and grow it faster; ok lots of devsOtto Moerbeek
2019-11-18Enable ESP UDP-encapsulation with '-t' flag.tobhe
ok patrick@
2019-11-16Missing comma after RTM_PROPOSAL source.Kenneth R Westerback
ok bluhm@
2019-11-16When printing RTM_PROPOSAL and unspecified message types, print theKenneth R Westerback
interface name if known. As all the other message types do. ok bluhm@
2019-11-16When printing RTM_PROPOSAL messages use "if#" like all the otherKenneth R Westerback
messages, not "ifidx". ok bluhm@
2019-11-16More %d -> %u for unsigned values.Kenneth R Westerback
2019-11-16Whitespace nit.Kenneth R Westerback
ok bluhm@
2019-11-16rtm_version, rtm_type, rtm_msglen, rtm_index, rtm_priority, ifan_whatKenneth R Westerback
are u_char or u_short. So use %u instead of %d in printf(). ok bluhm@
2019-11-16Remove "(void)" casts from the 2 printf() statements thatKenneth R Westerback
had them. ok bluhm@
2019-11-15IKEv2 message fragments of the same message have the same msg_id. Whentobhe
fragmentation was added every incoming message increased the internal msg_id count. Fragments were handled with an explicit exception. Now that we have msg_valid we can increase the SA's msg_id counter only with the reconstructed message and remove the exception. ok bluhm@
2019-11-15Fix error handling in ikev2_msg_send.tobhe
Check sa is not NULL before using it. Use sa consistently instead of mixing sa and msg->msg_sa. In the error case, if sa is not NULL, save the message for retransmission and return 0 instead of -1. ok mikeb@