Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 634
    • Issues 634
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 90
    • Merge requests 90
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Merge requests
  • !5816

Draft: Fix local address extraction for dispatch sockets

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Michał Kępień requested to merge 3143-fix-local-address-extraction-for-dispatch-sockets into main Feb 10, 2022
  • Overview 19
  • Commits 3
  • Pipelines 2
  • Changes 8

When dispatch code was migrated to netmgr, the isc_socket_getsockname() function, previously used i.a. for determining the local address of a dispatch socket, was replaced with dns_dispentry_getlocaladdress(), which uses isc_nmhandle_localaddr() behind the scenes. The latter is simply a getter for the 'local' field of a given isc_nmhandle_t. This works as expected for listening sockets as their handles are initialized with a specific local address. However, that is not the case for dispatch sockets unless the "query-source(-v6)" option is set to an explicit IP address. This issue results in local addresses missing from dnstap captures of resolver traffic produced by named in the default configuration.

Extend isc_nmhandle_localaddr() so that it extracts the local address a given dispatch socket is bound to using uv_{tcp,udp}_getsockname(). Only do this for TCPDNS and UDP sockets, falling back to returning the 'local' field for other types of sockets (because dispatch sockets can currently only be TCPDNS or UDP sockets).

Closes #3143 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 3143-fix-local-address-extraction-for-dispatch-sockets