Skip to content

Commit 71fe60b

Browse files
authored
Merge pull request #266 from jakub-racek-swi/main
Enable full DNS names
2 parents 21df659 + 95569c7 commit 71fe60b

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

collector/kernel/buffered_poller.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ void BufferedPoller::handle_dns_message(message_metadata const &metadata, jb_age
414414

415415
send_a_aaaa_response = 1;
416416
// truncate hostname */
417-
sent_hostname_len = (hostname_len < MAX_ENCODED_DOMAIN_NAME) ? (u16)hostname_len : MAX_ENCODED_DOMAIN_NAME;
417+
sent_hostname_len = (hostname_len < DNS_NAME_MAX_LENGTH) ? (u16)hostname_len : DNS_NAME_MAX_LENGTH;
418418
sent_hostname = hostname_out + hostname_len - sent_hostname_len;
419419
}
420420

@@ -534,7 +534,7 @@ void BufferedPoller::timeout_dns_request(u64 timestamp_ns, const DnsRequests::Re
534534
const char *hostname_out = req->first.name.c_str();
535535
size_t hostname_len = req->first.name.size();
536536

537-
u16 sent_hostname_len = (hostname_len < MAX_ENCODED_DOMAIN_NAME) ? (u16)hostname_len : MAX_ENCODED_DOMAIN_NAME;
537+
u16 sent_hostname_len = (hostname_len < DNS_NAME_MAX_LENGTH) ? (u16)hostname_len : DNS_NAME_MAX_LENGTH;
538538

539539
const char *sent_hostname = hostname_out + hostname_len - sent_hostname_len;
540540

collector/kernel/dns/dns.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ extern "C" {
1212
#endif /* __cplusplus */
1313

1414
#define DNS_NAME_MAX_LENGTH 256
15-
16-
#define MAX_ENCODED_DOMAIN_NAME 80
1715
#define MAX_ENCODED_IP_ADDRS 16
1816

1917
#define MAX_ENCODED_DNS_MESSAGE \
2018
(/* timestamp */ sizeof(u64) + /* jb message */ jb_ingest__dns_response__data_size + \
21-
/* ip addrs */ (sizeof(u32) * MAX_ENCODED_IP_ADDRS) + /* DNS name */ MAX_ENCODED_DOMAIN_NAME)
19+
/* ip addrs */ (sizeof(u32) * MAX_ENCODED_IP_ADDRS) + /* DNS name */ DNS_NAME_MAX_LENGTH)
2220

2321
int dns_name_length(const unsigned char *encoded, const unsigned char *abuf, int alen);
2422

reducer/dns_cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace reducer {
1717
namespace dns {
1818
struct hash_ipv6_address;
1919
struct eq_ipv6_address;
20-
static constexpr u32 max_len = 80;
20+
static constexpr u32 max_len = 256;
2121
typedef short_string<max_len> dns_record;
2222
} // namespace dns
2323

render/ebpf_net.render

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ app ingest {
10411041
description "DNS A/AAAA record query response, with name, response address(es), and latency information"
10421042
severity 0
10431043
1: u32 sk_id
1044-
2: u16 total_dn_len // Total length of domain name without truncation (MAX_ENCODED_DOMAIN_NAME)
1044+
2: u16 total_dn_len // Total length of domain name without truncation (DNS_NAME_MAX_LENGTH)
10451045
3: string domain_name // Domain name being queried (possibly truncated)
10461046
4: string ipv4_addrs // IPv4 addresses corresponding to domain name 'dn'
10471047
5: string ipv6_addrs // IPv6 addresses corresponding to domain name 'dn'
@@ -1051,7 +1051,7 @@ app ingest {
10511051
description "A DNS A/AAAA record request timeout"
10521052
severity 0
10531053
1: u32 sk_id
1054-
2: u16 total_dn_len // Total length of domain name without truncation (MAX_ENCODED_DOMAIN_NAME)
1054+
2: u16 total_dn_len // Total length of domain name without truncation (DNS_NAME_MAX_LENGTH)
10551055
3: string domain_name // Domain name being queried (possibly truncated)
10561056
4: u64 timeout_ns // Timeout duration for request (in ns)
10571057
}
@@ -1065,7 +1065,7 @@ app ingest {
10651065
description "DNS A/AAAA record query response, with name, response address(es), and latency information, with direction"
10661066
severity 0
10671067
1: u32 sk_id
1068-
2: u16 total_dn_len // Total length of domain name without truncation (MAX_ENCODED_DOMAIN_NAME)
1068+
2: u16 total_dn_len // Total length of domain name without truncation (DNS_NAME_MAX_LENGTH)
10691069
3: string domain_name // Domain name being queried (possibly truncated)
10701070
4: string ipv4_addrs // IPv4 addresses corresponding to domain name 'dn'
10711071
5: string ipv6_addrs // IPv6 addresses corresponding to domain name 'dn'
@@ -1329,7 +1329,7 @@ app matching {
13291329
pool_size 4800000
13301330
proxy aggregation.agg_root shard_by (role1, az1, role2, az2)
13311331
string<80> role1
1332-
string<80> role2
1332+
string<256> role2
13331333
string<32> az1
13341334
string<32> az2
13351335
}
@@ -1429,7 +1429,7 @@ app aggregation {
14291429
span role {
14301430
pool_size 70000
14311431
index (s, version, env, ns, node_type, process, container)
1432-
string<80> s
1432+
string<256> s
14331433
string<80> uid
14341434
string<64> version
14351435
string<32> env

0 commit comments

Comments
 (0)