Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embedded dnsmasq to v2.88test3 #1469

Merged
merged 46 commits into from
Nov 10, 2022
Merged

Update embedded dnsmasq to v2.88test3 #1469

merged 46 commits into from
Nov 10, 2022

Commits on Nov 9, 2022

  1. Add --port-limit option.

    By default, when sending a query via random ports to multiple upstream servers or
    retrying a query dnsmasq will use a single random port for all the tries/retries.
    This option allows a larger number of ports to be used, which can increase robustness
    in certain network configurations. Note that increasing this to more than
    two or three can have security and resource implications and should only
    be done with understanding of those.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    f3bf548 View commit details
    Browse the repository at this point in the history
  2. Add --fast-dns-retry option.

    This gives dnsmasq the ability to originate retries for upstream DNS
    queries itself, rather than relying on the downstream client. This is
    most useful when doing DNSSEC over unreliable upstream network. It
    comes with some cost in memory usage and network bandwidth.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    c7a4c2d View commit details
    Browse the repository at this point in the history
  3. Add --use-stale-cache option.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    cf06741 View commit details
    Browse the repository at this point in the history
  4. Remove fast-retry development logging.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    00f7c4e View commit details
    Browse the repository at this point in the history
  5. Fix namebuff overwrite leading to wrong log after socket bind warning.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    d4065af View commit details
    Browse the repository at this point in the history
  6. Second try at port-limit option.

    1) It's expected to fail to bind a new source port when they
       are scarce, suppress warning in log in this case.
    
    2) Optimse bind_local when max_port - min_port is small. There's no
       randomness in this case, so we try all possible source ports
       rather than poking at random ones for an arbitrary number of tries.
    
    3) In allocate_rfd() handle the case that all available source ports
       are already open. In this case we need to pick an existing
       socket/port to use, such that it has a different port from any we
       already hold. This gives the required property that the set of ports
       utilised by any given query is set by --port-limit and we don't
       re-use any until we have port-limit different ones.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    281063a View commit details
    Browse the repository at this point in the history
  7. Further optimisation of --port-limit.

    No longer try and fail to open every port when the port range
    is in complete use; go straight to re-using an existing socket.
    
    Die at startup if port range is smaller than --port-limit, since
    the code behaves badly in this case.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    10dcef3 View commit details
    Browse the repository at this point in the history
  8. Add GetServerMetrics method to DBus interface.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    7fe84ae View commit details
    Browse the repository at this point in the history
  9. Add stale cache replies to metrics.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    8f2d7b5 View commit details
    Browse the repository at this point in the history
  10. Return EDE_STALE extended error when returning stale data from cache.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    11119f7 View commit details
    Browse the repository at this point in the history
  11. Remove unused vars.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    ee80725 View commit details
    Browse the repository at this point in the history
  12. Make fast-retry more configurable and do exponential backoff.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    039e2b3 View commit details
    Browse the repository at this point in the history
  13. Add metric for queries which never see an answer.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    85fdfb0 View commit details
    Browse the repository at this point in the history
  14. Count NXDOMAIN replies from each server.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    3d5b4e2 View commit details
    Browse the repository at this point in the history
  15. Combine server stats from all records for the same server in DBUS met…

    …hod.
    
    The DBUS per-server stats method should combine the stats from
    different records (for different domains) in the same way at the
    logging code.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    7cae4bd View commit details
    Browse the repository at this point in the history
  16. Keep a per-DNS-server moving average of query latency.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    b9957e4 View commit details
    Browse the repository at this point in the history
  17. Tweak server-selection logic in the fast-retry case.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    861f529 View commit details
    Browse the repository at this point in the history
  18. Split failed queries in retries in stat counting.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    a599278 View commit details
    Browse the repository at this point in the history
  19. Initialise modified-moving-average latency calc better.

    Use the first value, rather than initialising at zero,
    which takes many queries to converge.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    5935160 View commit details
    Browse the repository at this point in the history
  20. Don't exclude stale-cache answers from "local answered" metric.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    0fd2a13 View commit details
    Browse the repository at this point in the history
  21. Optimise cache code when stale caching in use.

    Exclude DNSSEC entries from stale caching.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    f4e3592 View commit details
    Browse the repository at this point in the history
  22. Add ClearMetrics Dbus method.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    976e932 View commit details
    Browse the repository at this point in the history
  23. Fix bug in --dynamic-host when interface has /16 IPv4 address.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    5929989 View commit details
    Browse the repository at this point in the history
  24. Update embedded dnsmasq to v2.88test1

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    d398298 View commit details
    Browse the repository at this point in the history
  25. Locally blocked queries are not stale

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    0dc0533 View commit details
    Browse the repository at this point in the history
  26. Improve logging of DNS record source from --hostsdir files.

    Patch author Dominik Derigs <dl6er@dl6er.de> with subsequent bugfixes
    and tweaks from Simon Kelley.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    652c1e8 View commit details
    Browse the repository at this point in the history
  27. Enhance --hostdir so that records are automatically removed when re-r…

    …eading.
    
    Initial patch from Dominik Derigs, re-written by Simon Kelley.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    e8d19f7 View commit details
    Browse the repository at this point in the history
  28. Handle multiple addresses when removing duplicates in host files.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    a1b66e8 View commit details
    Browse the repository at this point in the history
  29. Fix loss of DNS servers on config reload.

    A bug, introduced in 2.87, which could result in DNS
    servers being removed from the configuration when reloading
    server configuration from DBus, or re-reading /etc/resolv.conf
    Only servers from the same source should be replaced, but some
    servers from other sources (ie hard coded or another dynamic source)
    could mysteriously disappear.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    4cfb84a View commit details
    Browse the repository at this point in the history
  30. Add --no-round-robin option.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    cdf9d9d View commit details
    Browse the repository at this point in the history
  31. Fix in dhcpv4 rapid-commit code.

    1) Cosmetic: don't log the tags twice.
    
    2) Functional. If a host has an old lease for a different address,
       the rapid-commit will appear to work, but the old lease will
       not be removed and the new lease will not be recorded, so
       the client and server will have conflicting state, leading to
       problems later.
    
    Signed-off-by: Dominik Derigs <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    3a6dd32 View commit details
    Browse the repository at this point in the history
  32. Do not (try to) re-read deleted files inside a --hostsdir.

    Signed-off-by: Dominik Derigs <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    779ba10 View commit details
    Browse the repository at this point in the history
  33. Inotify: make "flushed" log message more understandable.

    Saying we've "flushed x outdated entries" is confusing, since
    the count is the total number of entries in the modified file,
    most of which are going	to get added straight back when	the file
    is re-read.
    
    The log now looks like
    
    dnsmasq: inotify: /tmp/dir/1 (new or modified)
    dnsmasq: inotify: flushed 1 addresses read from /tmp/dir/1
    dnsmasq: read /tmp/dir/1 - 2 addresses
    
    which hopefully make it more obvious that /tmp/dir/1 contained one
    address before, and now contains two.
    
    Signed-off-by: Dominik Derigs <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    8aba33f View commit details
    Browse the repository at this point in the history
  34. Reconcile "names" and "address" counts when reading hostfiles.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    2bf2863 View commit details
    Browse the repository at this point in the history
  35. Allow domain names as well is IP addresses in --server options.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    703ee7e View commit details
    Browse the repository at this point in the history
  36. Fix breakage of --local=/domain.name/1.2.3.4 in immediately previous …

    …commit.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    1b2612c View commit details
    Browse the repository at this point in the history
  37. Extend specifying DNS servers by domain-name to --rev-server

    Also Dbus SetDomainServers method.
    
    Revert getaddrinfo hints.ai_socktype to SOCK_DGRAM to eliminate
    duplicating every address three times for DGRAM, STREAM and RAW
    in the results.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    891acaa View commit details
    Browse the repository at this point in the history
  38. Add dnsmasq tag v2.88test2

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    801f034 View commit details
    Browse the repository at this point in the history
  39. Add support for dnsmasq flags F_SRV and F_STALE

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    42c7105 View commit details
    Browse the repository at this point in the history
  40. Allow FTL to analyze stale cache replies. They are assigned to a new …

    …query type (17)
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    7ecd358 View commit details
    Browse the repository at this point in the history
  41. Call freeaddrinfo() in domain_rev[46]()

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    0ae86d2 View commit details
    Browse the repository at this point in the history
  42. Make specifying nameservers by name work for DBus API.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    ed8d37b View commit details
    Browse the repository at this point in the history
  43. Fix --server with multiple domains.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    1449829 View commit details
    Browse the repository at this point in the history
  44. Fix --server=/domain/#

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    simonkelley authored and DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    2a94aef View commit details
    Browse the repository at this point in the history
  45. Add dnsmasq tag v2.88test3

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    5556dd5 View commit details
    Browse the repository at this point in the history
  46. Fix incorrect three-way merge happened when importing the stale-cache…

    … patch
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    4b798e8 View commit details
    Browse the repository at this point in the history