mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Include destination address port number in query logging
When query logging is enabled, named will now include the destination
address port in the logged message.
Example messages for before and after this change:
before: client @0x7608b2026000 10.53.0.1#52136 (example.test): query: example.test IN A +E(0)K (10.53.0.1)
after: client @0x729bf5c26000 10.53.0.1#35976 (example.test): query: example.test IN A +E(0)K (10.53.0.1#53)
This commit is contained in:
parent
f8802cbfa0
commit
19843f6c9d
1 changed files with 3 additions and 3 deletions
|
|
@ -11603,7 +11603,7 @@ log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
|
|||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
char typebuf[DNS_RDATATYPE_FORMATSIZE];
|
||||
char classbuf[DNS_RDATACLASS_FORMATSIZE];
|
||||
char onbuf[ISC_NETADDR_FORMATSIZE];
|
||||
char sabuf[ISC_SOCKADDR_FORMATSIZE];
|
||||
char ecsbuf[NS_CLIENT_ECS_FORMATSIZE] = { 0 };
|
||||
char flagsbuf[NS_CLIENT_FLAGS_FORMATSIZE] = { 0 };
|
||||
dns_rdataset_t *rdataset;
|
||||
|
|
@ -11618,7 +11618,7 @@ log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
|
|||
dns_name_format(client->query.qname, namebuf, sizeof(namebuf));
|
||||
dns_rdataclass_format(rdataset->rdclass, classbuf, sizeof(classbuf));
|
||||
dns_rdatatype_format(rdataset->type, typebuf, sizeof(typebuf));
|
||||
isc_netaddr_format(&client->destaddr, onbuf, sizeof(onbuf));
|
||||
isc_sockaddr_format(&client->destsockaddr, sabuf, sizeof(sabuf));
|
||||
|
||||
if (HAVEECS(client)) {
|
||||
ns_client_log_ecs(client, ecsbuf, sizeof(ecsbuf));
|
||||
|
|
@ -11628,7 +11628,7 @@ log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
|
|||
|
||||
ns_client_log(client, NS_LOGCATEGORY_QUERIES, NS_LOGMODULE_QUERY, level,
|
||||
"query: %s %s %s %s (%s)%s", namebuf, classbuf, typebuf,
|
||||
flagsbuf, onbuf, ecsbuf);
|
||||
flagsbuf, sabuf, ecsbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue