1. 09 Jan, 2019 3 commits
  2. 08 Jan, 2019 1 commit
    • Michał Kępień's avatar
      Track forwarder timeouts in fetch contexts · 33350626
      Michał Kępień authored
      Since following a delegation resets most fetch context state, address
      marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
      preserved when a delegation is followed.  This is fine for full
      recursive resolution but when named is configured with "forward first;"
      and one of the specified forwarders times out, triggering a fallback to
      full recursive resolution, that forwarder should no longer be consulted
      at each delegation point subsequently reached within a given fetch
      context.
      
      Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
      forwarder as bad when it times out in a "forward first;" configuration.
      Since the bad server list is not cleaned when a fetch context follows a
      delegation, this prevents a forwarder from being queried again after
      falling back to full recursive resolution.  Yet, as each fetch context
      maintains its own list of bad servers, this change does not cause a
      forwarder timeout to prevent that forwarder from being used by other
      fetch contexts.
      33350626
  3. 20 Dec, 2018 1 commit
  4. 19 Dec, 2018 7 commits
  5. 17 Dec, 2018 1 commit
  6. 14 Dec, 2018 3 commits
  7. 11 Dec, 2018 2 commits
  8. 10 Dec, 2018 1 commit
  9. 07 Dec, 2018 5 commits
  10. 06 Dec, 2018 16 commits
    • Michał Kępień's avatar
      make hook actions return an enum instead of a bool · 0e12988d
      Michał Kępień authored
      Use an enum instead of a bool for the return type of hook actions in
      order to facilitate adding further hook processing models in the future.
      0e12988d
    • Evan Hunt's avatar
      revise hooks.h comments · f70a8453
      Evan Hunt authored
      f70a8453
    • Michał Kępień's avatar
      add a function for processing a list of configured plugins · 42349687
      Michał Kępień authored
      Add a new libisccfg function, cfg_pluginlist_foreach(), which allows an
      arbitrary callback to be invoked for every "plugin" stanza present in a
      configuration object.  Use this function for both loading plugins and
      checking their configuration in order to reduce duplication of
      configuration processing code present in bin/named/server.c and
      lib/bind9/check.c.
      42349687
    • Evan Hunt's avatar
      name change from "hook modules" to "plugins" · fd20f10d
      Evan Hunt authored
      - "hook" is now used only for hook points and hook actions
      - the "hook" statement in named.conf is now "plugin"
      - ns_module and ns_modlist are now ns_plugin and ns_plugins
      - ns_module_load is renamed ns_plugin_register
      - the mandatory functions in plugin modules (hook_register,
        hook_check, hook_version, hook_destroy) have been renamed
      fd20f10d
    • Evan Hunt's avatar
      8da0c0e7
    • Evan Hunt's avatar
      restore filter-aaaa syntax checking · 7a47e4d8
      Evan Hunt authored
      - added functionality to check hook parameters in named-checkconf,
        and restored the checkconf tests that were removed from the
        filter-aaaa test.
      7a47e4d8
    • Evan Hunt's avatar
      refactor to support multiple module instances · b94945e6
      Evan Hunt authored
      - use a per-view module list instead of global hook_modules
      - create an 'instance' pointer when registering modules, store it in
        the module structure, and use it as action_data when calling
        hook functions - this enables multiple module instances to be set
        up in parallel
      - also some nomenclature changes and cleanup
      b94945e6
    • Evan Hunt's avatar
      add additional hook points, plus some minor refactoring · 9df0bdc9
      Evan Hunt authored
      - added some hook points that will be needed for a dns64 module later
      - moved some code from the beginning of query_respond() to
        the end of query_prepresponse(); this has no effect on functionality
        but means we can have a hook point at the top of query_respond(),
        which seems nicer
      - compressed duplicated code into query_zerottl_refetch() function
      - added a qctx->answered flag so that a module can prevent
        query_addrrset() from being called from query_respond() when
        it's already been called from the module.
      9df0bdc9
    • Evan Hunt's avatar
      copy ns_hook objects before adding them to a hook table · 0b988256
      Evan Hunt authored
      - this is necessary because adding the same hook to multiple views
        causes the ISC_LIST link value to become inconsistent; it isn't
        noticeable when only one hook action is ever registered at a
        given hook point, but it will break things when there are two.
      0b988256
    • Evan Hunt's avatar
      use entirely local persistent data in modules · 74683fbc
      Evan Hunt authored
      - eliminate qctx->hookdata and client->hookflags.
      - use a memory pool to allocate data blobs in the filter-aaaa module,
        and associate them with the client address in a hash table
      - instead of detaching the client in query_done(), mark it for deletion
        and then call ns_client_detach() from qctx_destroy(); this ensures
        that it will still exist when the QCTX_DESTROYED hook point is
        reached.
      74683fbc
    • Evan Hunt's avatar
      8725f573
    • Evan Hunt's avatar
      clear AD flag when altering response messages · 427e9ca3
      Evan Hunt authored
      - the AD flag was not being cleared correctly when filtering
      - enabled dnssec valdiation in the filter-aaaa test to confirm this
        works correctly now
      427e9ca3
    • Evan Hunt's avatar
      improve hook processing macros · 055bf266
      Evan Hunt authored
      - use a get_hooktab() function to determine the hook table.
      - PROCESS_HOOK now jumps to a cleanup tag on failure
      - add PROCESS_ALL_HOOKS in query.c, to run all hook functions at
        a specified hook point without stopping. this is to be used for
        intiialization and destruction functions that must run in every
        module.
      - 'result' is set in PROCESS_HOOK only when a hook function
        interrupts processing.
      - revised terminology: a "callback" is now a "hook action"
      - remove unused NS_PROCESS_HOOK and NS_PROCESS_HOOK_VOID macros.
      055bf266
    • Evan Hunt's avatar
      enable modules to store data in qctx · 81f58e2e
      Evan Hunt authored
      - added a 'hookdata' array to qctx to store pointers to up to
        16 blobs of data which are allocated by modules as needed.
        each module is assigned an ID number as it's loaded, and this
        is the index into the hook data array. this is to be used for
        holding persistent state between calls to a hook module for a
        specific query.
      - instead of using qctx->filter_aaaa, we now use qctx->hookdata.
        (this was the last piece of filter-aaaa specific code outside the
        module.)
      - added hook points for qctx initialization and destruction. we get
        a filter-aaaa data pointer from the mempool when initializing and
        store it in the qctx->hookdata table; return to to the mempool
        when destroying the qctx.
      - link the view to the qctx so that detaching the client doesn't cause
        hooks to fail
      - added a qctx_destroy() function which must be called after qctx_init;
        this calls the QCTX_DESTROY hook and detaches the view
      - general cleanup and comments
      81f58e2e
    • Evan Hunt's avatar
      add a parser to filter-aaaa.so and pass in the parameters · 9911c835
      Evan Hunt authored
      - make some cfg-parsing functions global so they can be run
        from filter-aaaa.so
      - add filter-aaaa options to the hook module's parser
      - mark filter-aaaa options in named.conf as obsolete, remove
        from named and checkconf, and update the filter-aaaa test not to
        use checkconf anymore
      - remove filter-aaaa-related struct members from dns_view
      9911c835
    • Evan Hunt's avatar
      add hook statement to configuration parser · d2f46443
      Evan Hunt authored
      - allow multiple "hook" statements at global or view level
      - add "optional bracketed text" type for optional parameter list
      - load hook module from specified path rather than hardcoded path
      - add a hooktable pointer (and a callback for freeing it) to the
        view structure
      - change the hooktable functions so they no longer update ns__hook_table
        by default, and modify PROCESS_HOOK so it uses the view hooktable, if
        set, rather than ns__hook_table. (ns__hook_table is retained for
        use by unit tests.)
      - update the filter-aaaa system test to load filter-aaaa.so
      - add a prereq script to check for dlopen support before running
        the filter-aaaa system test
      
      not yet done:
      - configuration parameters are not being passed to the filter-aaaa
        module; the filter-aaaa ACL and filter-aaaa-on-{v4,v6} settings are
        still stored in dns_view
      d2f46443