Skip to content
GitLab
Projects Groups 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
    • Contributors
    • Graph
    • Compare
  • Issues 606
    • Issues 606
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 87
    • Merge requests 87
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • 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
  • !6191

Fix destination port extraction for client queries

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Michał Kępień requested to merge 3309-fix-destination-port-extraction-for-client-queries into main Apr 27, 2022
  • Overview 11
  • Commits 3
  • Pipelines 7
  • Changes 3

The current logic for determining the address of the socket to which a client sent its query is:

  1. Get the address:port tuple from the netmgr handle using isc_nmhandle_localaddr().

  2. Convert the address:port tuple from step 1 into an isc_netaddr_t using isc_netaddr_fromsockaddr().

  3. Convert the address from step 2 back into a socket address with the port set to 0 using isc_sockaddr_fromnetaddr().

Note that the port number (readily available in the netmgr handle) is needlessly lost in the process, preventing it from being recorded in dnstap captures of client traffic produced by named.

Fix by first storing the address:port tuple returned by isc_nmhandle_localaddr() in client->destsockaddr and then creating an isc_netaddr_t from that structure. This allows the port number to be retained in client->destsockaddr, which is what subsequently gets passed to dns_dt_send().

Closes #3309 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 3309-fix-destination-port-extraction-for-client-queries