1. 24 Jul, 2020 2 commits
  2. 13 Jul, 2020 1 commit
  3. 20 May, 2020 1 commit
    • Witold Krecicki's avatar
      Fix possible deadlock in unix/socket.c · 0eec2594
      Witold Krecicki authored
      In process_fd we lock sock->lock and then internal_accept locks mgr->lock,
      in isc_sockmgr_render* functions we lock mgr->lock and then lock sock->lock,
      that can cause a deadlock when accessing stats. Unlock sock->lock early in
      all the internal_{send,recv,connect,accept} functions instead of late
      in process_fd.
  4. 01 May, 2020 1 commit
  5. 21 Apr, 2020 1 commit
    • Ondřej Surý's avatar
      Complete rewrite the BIND 9 build system · 978c7b2e
      Ondřej Surý authored
      The rewrite of BIND 9 build system is a large work and cannot be reasonable
      split into separate merge requests.  Addition of the automake has a positive
      effect on the readability and maintainability of the build system as it is more
      declarative, it allows conditional and we are able to drop all of the custom
      make code that BIND 9 developed over the years to overcome the deficiencies of
      autoconf + custom Makefile.in files.
      This squashed commit contains following changes:
      - conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
        by using automake
      - the libtool is now properly integrated with automake (the way we used it
        was rather hackish as the only official way how to use libtool is via
      - the dynamic module loading was rewritten from a custom patchwork to libtool's
        libltdl (which includes the patchwork to support module loading on different
        systems internally)
      - conversion of the unit test executor from kyua to automake parallel driver
      - conversion of the system test executor from custom make/shell to automake
        parallel driver
      - The GSSAPI has been refactored, the custom SPNEGO on the basis that
        all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
        support SPNEGO mechanism.
      - The various defunct tests from bin/tests have been removed:
        bin/tests/optional and bin/tests/pkcs11
      - The text files generated from the MD files have been removed, the
        MarkDown has been designed to be readable by both humans and computers
      - The xsl header is now generated by a simple sed command instead of
        perl helper
      - The <irs/platform.h> header has been removed
      - cleanups of configure.ac script to make it more simpler, addition of multiple
        macros (there's still work to be done though)
      - the tarball can now be prepared with `make dist`
      - the system tests are partially able to run in oot build
      Here's a list of unfinished work that needs to be completed in subsequent merge
      - `make distcheck` doesn't yet work (because of system tests oot run is not yet
      - documentation is not yet built, there's a different merge request with docbook
        to sphinx-build rst conversion that needs to be rebased and adapted on top of
        the automake
      - msvc build is non functional yet and we need to decide whether we will just
        cross-compile bind9 using mingw-w64 or fix the msvc build
      - contributed dlz modules are not included neither in the autoconf nor automake
  6. 09 Mar, 2020 1 commit
  7. 03 Mar, 2020 1 commit
    • Witold Krecicki's avatar
      Fix a race in isc_socket destruction. · 81ba0fe0
      Witold Krecicki authored
      There was a very slim chance of a race between isc_socket_detach and
      process_fd: isc_socket_detach decrements references to 0, and before it
      calls destroy gets preempted. Second thread calls process_fd, increments
      socket references temporarily to 1, and then gets preempted, first thread
      then hits assertion in destroy() as the reference counter is now 1 and
      not 0.
  8. 21 Feb, 2020 1 commit
  9. 17 Feb, 2020 1 commit
  10. 14 Feb, 2020 1 commit
  11. 13 Feb, 2020 2 commits
    • Evan Hunt's avatar
      apply the modified style · e851ed0b
      Evan Hunt authored
    • Ondřej Surý's avatar
      Use clang-tidy to add curly braces around one-line statements · 056e133c
      Ondřej Surý authored
      The command used to reformat the files in this commit was:
      ./util/run-clang-tidy \
      	-clang-tidy-binary clang-tidy-11
      	-clang-apply-replacements-binary clang-apply-replacements-11 \
      	-checks=-*,readability-braces-around-statements \
      	-j 9 \
      	-fix \
      	-format \
      	-style=file \
      clang-format -i --style=format $(git ls-files '*.c' '*.h')
      uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
      clang-format -i --style=format $(git ls-files '*.c' '*.h')
  12. 12 Feb, 2020 1 commit
  13. 10 Feb, 2020 1 commit
  14. 14 Jan, 2020 2 commits
    • Ondřej Surý's avatar
      Remove duplicate INSIST checks for isc_refcount API · 6afa9936
      Ondřej Surý authored
      This commits removes superfluous checks when using the isc_refcount API.
      Examples of superfluous checks:
      1. The isc_refcount_decrement function ensures there was not underflow,
         so this check is superfluous:
          INSIST(isc_refcount_decrement(&r) > 0);
      2 .The isc_refcount_destroy() includes check whether the counter
         is zero, therefore this is superfluous:
          INSIST(isc_refcount_decrement(&r) == 1 && isc_refcount_destroy(&r));
    • Ondřej Surý's avatar
  15. 12 Dec, 2019 2 commits
  16. 06 Nov, 2019 1 commit
  17. 03 Oct, 2019 1 commit
  18. 24 Sep, 2019 3 commits
  19. 04 Sep, 2019 1 commit
  20. 30 Aug, 2019 1 commit
    • Ondřej Surý's avatar
      isc_event_allocate() cannot fail, remove the fail handling blocks · 50e109d6
      Ondřej Surý authored
      isc_event_allocate() calls isc_mem_get() to allocate the event structure.  As
      isc_mem_get() cannot fail softly (e.g. it never returns NULL), the
      isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL)
      handling blocks using the semantic patch from the previous commit.
  21. 31 Jul, 2019 3 commits
    • Ondřej Surý's avatar
      Make isc_thread_join() assert internally on failure · 46919579
      Ondřej Surý authored
      Previously isc_thread_join() would return ISC_R_UNEXPECTED on a failure to
      create new thread.  All such occurences were caught and wrapped into assert
      function at higher level.  The function was simplified to assert directly in the
      isc_thread_join() function and all caller level assertions were removed.
    • Ondřej Surý's avatar
      Make isc_thread_create() assert internally on failure · d6a60f29
      Ondřej Surý authored
      Previously isc_thread_create() would return ISC_R_UNEXPECTED on a failure to
      create new thread.  All such occurences were caught and wrapped into assert
      function at higher level.  The function was simplified to assert directly in the
      isc_thread_create() function and all caller level assertions were removed.
    • Ondřej Surý's avatar
      Replace usage of isc_mem_put+isc_mem_detach with isc_mem_putanddetach · a6dcdc53
      Ondřej Surý authored
      Using isc_mem_put(mctx, ...) + isc_mem_detach(mctx) required juggling with the
      local variables when mctx was part of the freed object. The isc_mem_putanddetach
      function can handle this case internally, but it wasn't used everywhere.  This
      commit apply the semantic patching plus bit of manual work to replace all such
      occurrences with proper usage of isc_mem_putanddetach().
  22. 30 Jul, 2019 1 commit
  23. 23 Jul, 2019 1 commit
  24. 01 Jul, 2019 1 commit
    • Ondřej Surý's avatar
      Remove SO_BSDCOMPAT usage, it's ignore since Linux 2.4 · 209b2e53
      Ondřej Surý authored
      The SO_BSDCOMPAT socket option is no-op since Linux 2.4, see the manpage:
      	Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol
      	module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP
      	socket will not be passed to the user program.  In later kernel
      	versions, support for this option has been phased out: Linux 2.4
      	silently ignores it, and Linux 2.6 generates a kernel warning (printk())
      	if a program uses this option.  Linux 2.0 also enabled BSD bug-to-bug
      	compatibility options (random header changing, skipping of the broadcast
      	flag) for raw sockets with this option, but that was removed in Linux
  25. 25 Jun, 2019 2 commits
  26. 24 Jun, 2019 1 commit
  27. 31 May, 2019 1 commit
    • Witold Krecicki's avatar
      Fix a possible race between udp dispatch and socket code · e517c18d
      Witold Krecicki authored
      There's a small possibility of race between udp dispatcher and
      socket code - socket code can still hold internal reference to a
      socket while dispatcher calls isc_socket_open, which can cause
      an assertion failure. Fix it by relaxing the assertion test, and
      instead simply locking the socket in isc_socket_open.
  28. 29 May, 2019 1 commit
  29. 24 May, 2019 1 commit
    • Witold Krecicki's avatar
      Fix a possible deadlock in TCP accepting · 75815c15
      Witold Krecicki authored
      Each network thread holds an array of locks, indexed by a hash
      of fd. When we accept a connection we hold a lock in accepting thread.
      We then generate the thread number and lock bucket for the new
      connection socket - if we hit the same thread and lock bucket as
      accepting socket we get a deadlock. Avoid this by checking if we're
      in the same thread/lock bucket and not locking in this case.
  30. 20 May, 2019 1 commit
    • Ondřej Surý's avatar
      Make lib/isc/app.c opaque and thread-safe · eb8c9bdd
      Ondřej Surý authored
      This work cleans up the API which includes couple of things:
      1. Make the isc_appctx_t type fully opaque
      2. Protect all access to the isc_app_t members via stdatomics
      3. sigwait() is part of POSIX.1, remove dead non-sigwait code
      4. Remove unused code: isc_appctx_set{taskmgr,sockmgr,timermgr}
  31. 15 May, 2019 1 commit