bind9/lib/ns
Michał Kępień cbfb93e1c7 Fix destination port extraction for client queries
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() or from the ns_interface_t structure.

 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 or in
the ns_interface_t structure) 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 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().

Remove an outdated code comment.

(cherry picked from commit 2f945703f2)
2022-06-22 13:52:08 +02:00
..
include Update clang to version 14 2022-06-16 18:11:03 +02:00
tests Remove UNREACHABLE() statements after exit() 2022-03-25 10:08:39 +01:00
win32 Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
client.c Fix destination port extraction for client queries 2022-06-22 13:52:08 +02:00
hooks.c Don't use RTLD_DEEPBIND with sanitizers 2022-01-26 08:19:02 +00:00
interfacemgr.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
Kyuafile Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
lib.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
listenlist.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
log.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
Makefile.in Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
notify.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
query.c Cleanup: always count ns_statscounter_recursclients 2022-05-14 00:58:26 -07:00
server.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
sortlist.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
stats.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
update.c Log "not authoritative for update zone" more clearly 2022-03-30 13:24:56 +01:00
version.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
xfrout.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 09:37:18 +01:00