1. 05 Aug, 2020 1 commit
  2. 24 Jul, 2020 1 commit
  3. 15 Jul, 2020 1 commit
  4. 14 Jul, 2020 1 commit
  5. 25 Jun, 2020 1 commit
    • Mark Andrews's avatar
      Address potential thread issues: · a878e8d4
      Mark Andrews authored
      Assign and then check node for NULL to address another thread
      changing radix->head in the meantime.
      
      Move 'node != NULL' check into while loop test to silence cppcheck
      false positive.
      
      Fix pointer != NULL style.
      
      (cherry picked from commit 51f08d20)
      a878e8d4
  6. 18 Jun, 2020 1 commit
  7. 05 Jun, 2020 1 commit
  8. 03 Jun, 2020 1 commit
  9. 13 May, 2020 1 commit
  10. 16 Apr, 2020 6 commits
    • Michał Kępień's avatar
      Tweak library API versions · 255be080
      Michał Kępień authored
      255be080
    • Ondřej Surý's avatar
      _getcwd() on Windows needs direct.h header · 5e2d1991
      Ondřej Surý authored
      The _getcwd() compatibility function on Microsoft CRT requires direct.h
      header to pull a proper function prototype.
      
      The (misleading) warning generated:
      
        bin\named\server.c(1074): warning C4047: '==': 'int' differs in levels of indirection from 'void *'
      5e2d1991
    • Ondřej Surý's avatar
      7f672ab4
    • Ondřej Surý's avatar
      Disable MSB8028 warning · 5fd1df8c
      Ondřej Surý authored
      All our MSVS Project files share the same intermediate directory.  We
      know that this doesn't cause any problems, so we can just disable the
      detection in the project files.
      
      Example of the warning:
      
        warning MSB8028: The intermediate directory (.\Release\) contains files shared from another project (dnssectool.vcxproj).  This can lead to incorrect clean and rebuild behavior.
      
      (cherry picked from commit b6c2012d)
      5fd1df8c
    • Ondřej Surý's avatar
      Don't return from void function · 90108d47
      Ondřej Surý authored
      (cherry picked from commit 948a23e6)
      90108d47
    • Ondřej Surý's avatar
      Set WarningLevel to Level1 for Release, treat warnings as errors · 1eb5a77b
      Ondřej Surý authored
      Our vcxproj files set the WarningLevel to Level3, which is too verbose
      for a code that needs to be portable.  That basically leads to ignoring
      all the errors that MSVC produces.  This commits downgrades the
      WarningLevel to Level1 and enables treating warnings as errors for
      Release builds.  For the Debug builds the WarningLevel got upgraded to
      Level4, and treating warnings as errors is explicitly disabled.
      
      We should eventually make the code clean of all MSVC warnings, but it's
      a long way to go for Level4, so it's more reasonable to start at Level1.
      
      For reference[1], these are the warning levels as described by MSVC
      documentation:
      
        * /W0 suppresses all warnings. It's equivalent to /w.
        * /W1 displays level 1 (severe) warnings. /W1 is the default setting
          in the command-line compiler.
        * /W2 displays level 1 and level 2 (significant) warnings.
        * /W3 displays level 1, level 2, and level 3 (production quality)
          warnings. /W3 is the default setting in the IDE.
        * /W4 displays level 1, level 2, and level 3 warnings, and all level 4
          (informational) warnings that aren't off by default. We recommend
          that you use this option to provide lint-like warnings. For a new
          project, it may be best to use /W4 in all compilations. This option
          helps ensure the fewest possible hard-to-find code defects.
        * /Wall displays all warnings displayed by /W4 and all other warnings
          that /W4 doesn't include — for example, warnings that are off by
          default.
        * /WX treats all compiler warnings as errors. For a new project, it
          may be best to use /WX in all compilations; resolving all warnings
          ensures the fewest possible hard-to-find code defects.
      
      1. https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=vs-2019
      
      (cherry picked from commit 789d253e)
      1eb5a77b
  11. 26 Mar, 2020 1 commit
    • Ondřej Surý's avatar
      Fix 'Dead nested assignment' from scan-build-10 · ff814288
      Ondřej Surý authored
      This is the warning:
      
      In file included from print_test.c:47:
      ./../print.c:203:9: warning: Although the value stored to 'neg' is used in the enclosing expression, the value is never actually read from 'neg'
                      dot = neg = space = plus = left = zero = alt = h = l = q = z = 0;
                            ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      ff814288
  12. 20 Mar, 2020 2 commits
    • Tinderbox User's avatar
      Adjust lib/isc/api version · 4236979e
      Tinderbox User authored
      The libisc LIBINTERFACE bump for 9.11.17 is unnecessary.
      A lot of headers were altered but the ABI tool did not report anything.
      Trust the ABI tool on this and decrement LIBINTERFACE and increment
      LIBREVISION.
      4236979e
    • Tinderbox User's avatar
      prep 9.11.17 · d050ec24
      Tinderbox User authored
      Bumped the version file and added release line in CHANGES.
      
      API files:
      - lib/bind9/api:
        No changes because only changes in comments.
      - lib/dns/api:
        Increment LIBINTERFACE because of the added field structure in
        dns_struct_update.
      - lib/isc/api:
        Increment LIBINTERFACE because of the PKCS#11 replacement.
      - lib/isccc/api:
        No changes because no source code changes.
      - lib/isccfg/api:
        Increment LIBREVISION because of minor source code changes.
      - lib/lwres/api:
        No changes because no source code changes.
      
      I decided no changes to README.md or the release notes were necessary.
      
      Perflab graphs look sane.
      d050ec24
  13. 18 Mar, 2020 1 commit
  14. 17 Mar, 2020 2 commits
    • Ondřej Surý's avatar
      Add C11 localtime_r and gmtime_r shims for Windows · 5ae4d3d9
      Ondřej Surý authored
      On Windows, C11 localtime_r() and gmtime_r() functions are not
      available.  While localtime() and gmtime() functions are already thread
      safe because they use Thread Local Storage, it's quite ugly to #ifdef
      around every localtime_r() and gmtime_r() usage to make the usage also
      thread-safe on POSIX platforms.
      
      The commit adds wrappers around Windows localtime_s() and gmtime_s()
      functions.
      
      NOTE: The implementation of localtime_s and gmtime_s in Microsoft CRT
      are incompatible with the C standard since it has reversed parameter
      order and errno_t return type.
      
      (cherry picked from commit 08f4c7d6)
      5ae4d3d9
    • Evan Hunt's avatar
      fix a pointer-to-int cast error · 1dbd238c
      Evan Hunt authored
      (cherry picked from commit 6b766460)
      1dbd238c
  15. 06 Mar, 2020 1 commit
  16. 04 Mar, 2020 1 commit
    • Michał Kępień's avatar
      Fix cppcheck 1.89 warnings · ae7c0cca
      Michał Kępień authored
      cppcheck 1.89 enabled certain value flow analysis mechanisms [1] which
      trigger null pointer dereference false positives that were previously
      not reported.  It seems that cppcheck no longer treats at least some
      REQUIRE() assertion failures as fatal, so add extra assertion macro
      definitions to lib/isc/include/isc/util.h that are only used when the
      CPPCHECK preprocessor macro is defined; these definitions make cppcheck
      1.89 behave as expected.
      
      There is an important requirement for these custom definitions to work:
      cppcheck must properly treat abort() as a function which does not
      return.  In order for that to happen, the __GNUC__ macro must be set to
      a high enough number (because system include directories are used and
      system headers compile attributes away if __GNUC__ is not high enough).
      __GNUC__ is thus set to the major version number of the GCC compiler
      used, which is what that latter does itself during compilation.
      
      [1] https://github.com/danmar/cppcheck/commit/aaeec462e6d96bb70c2b1cf030979d09e2d7c959
      
      (cherry picked from commit abfde3d5)
      ae7c0cca
  17. 02 Mar, 2020 2 commits
    • Ondřej Surý's avatar
      Use standard PKCS#11 standard error codes instead of custom error codes · 5edc8b53
      Ondřej Surý authored
      * CKR_CRYPTOKI_ALREADY_INITIALIZED: This value can only be returned by
        `C_Initialize`. It means that the Cryptoki library has already been
        initialized (by a previous call to `C_Initialize` which did not have a
        matching `C_Finalize` call).
      
      * CKR_FUNCTION_NOT_SUPPORTED: The requested function is not supported by this
        Cryptoki library. Even unsupported functions in the Cryptoki API should have a
        "stub" in the library; this stub should simply return the value
        CKR_FUNCTION_NOT_SUPPORTED.
      
      * CKR_LIBRARY_LOAD_FAILED: The Cryptoki library could not load a dependent
        shared library.
      
      (cherry picked from commit f6922d6e)
      5edc8b53
    • Ondřej Surý's avatar
      Replace the OASIS PKCS#11 header file with one from p11-kit · 4b9cdbaf
      Ondřej Surý authored
      The OASIS pkcs11.h header has a restrictive license.  Replace the
      pkcs11.h pkcs11f.h and pkcs11t.h headers with pkcs11.h from p11-kit.
      
      For source distribution, the license for the OASIS headers itself
      doesn't pose any licensing problem when combined with MPL license, but
      it possibly creates problem for downstream distributors of BIND 9.
      
      (cherry picked from commit c47fad24)
      4b9cdbaf
  18. 25 Feb, 2020 1 commit
  19. 21 Feb, 2020 1 commit
  20. 12 Feb, 2020 1 commit
  21. 11 Feb, 2020 2 commits
    • Ondřej Surý's avatar
      Convert all atomic operations in isc_rwlock to sequentially-consistent ordering · f71a8d11
      Ondřej Surý authored
      The memory ordering in the rwlock was all wrong, I am copying excerpts
      from the https://en.cppreference.com/w/c/atomic/memory_order#Relaxed_ordering
      for the convenience of the reader:
      
        Relaxed ordering
      
        Atomic operations tagged memory_order_relaxed are not synchronization
        operations; they do not impose an order among concurrent memory
        accesses. They only guarantee atomicity and modification order
        consistency.
      
        Sequentially-consistent ordering
      
        Atomic operations tagged memory_order_seq_cst not only order memory
        the same way as release/acquire ordering (everything that
        happened-before a store in one thread becomes a visible side effect in
        the thread that did a load), but also establish a single total
        modification order of all atomic operations that are so tagged.
      
      Which basically means that we had no or weak synchronization between
      threads using the same variables in the rwlock structure.  There should
      not be a significant performance drop because the critical sections were
      already protected by:
      
        while(1) {
          if (relaxed_atomic_operation) {
            break;
          }
          LOCK(lock);
          if (!relaxed_atomic_operation) {
            WAIT(sem, lock);
          }
          UNLOCK(lock)l
        }
      
      I would add one more thing to "Don't do your own crypto, folks.":
      
        - Also don't do your own locking, folks.
      
      As part of this commit, I have also cleaned up the #ifdef spaghetti,
      and fixed the isc_atomic API usage.
      f71a8d11
    • Ondřej Surý's avatar
      Make isc_rwlock.c thread-safe · 542517b1
      Ondřej Surý authored
      The ThreadSanitizer found several possible data races in our rwlock
      implementation.  This commit convert .spins and .write_granted fields
      to atomic.
      
      (cherry picked from commit 1da0994e)
      542517b1
  22. 08 Feb, 2020 8 commits
  23. 05 Feb, 2020 1 commit
    • Michal Nowak's avatar
      Windows: Prevent tools from clashing with named in system tests · 0e284831
      Michal Nowak authored
      In system tests on Windows tool's local port can sometimes clash with
      'named'. On Unix the system is poked for the minimal local port,
      otherwise is set to 32768 as a sane minimum. For Windows we don't
      poke but set a hardcoded limit; this change aligns the limit with
      Unix and changes it to 32768.
      
      (cherry picked from commit ed7fe5fa)
      0e284831
  24. 27 Jan, 2020 1 commit
    • Tinderbox User's avatar
      prep 9.11.15 · 296ccbf4
      Tinderbox User authored
      Update the API files.
      - lib/dns:
        - struct resolver has added elements, this is an interface change
          and thus LIBINTERFACE is incremented, and LIBREVISION is reset.
        - Since this also means an interface change since the last public
          release, also reset LIBAGE.
      - lib/isc:
        - The library source code changed, so increment LIBREVISION.
      - lib/isccfg:
        - The library source code changed, so increment LIBREVISION.
      
      Update other files:
      - No changes needed to the README, this is a small bugfix release.
      - Fix a bad version xml:id in the release notes.
      296ccbf4