Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions pkg/network/ebpf/c/prebuilt/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ int socket__dns_filter(struct __sk_buff* skb) {
if (!read_conn_tuple_skb(skb, &skb_info, &tup)) {
return 0;
}

__u16 sport = tup.sport;
__u16 dport = tup.dport;

if (bpf_map_lookup_elem(&dns_ports, &sport) != NULL) {
return -1;
}

if (dns_stats_enabled() && bpf_map_lookup_elem(&dns_ports, &dport) != NULL) {
return -1;
if (tup.sport != 53 && (!dns_stats_enabled() || tup.dport != 53)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve configured DNS monitoring ports in eBPF filter

This change hardcodes port 53 in socket__dns_filter and no longer consults the dns_ports map, which means network_config.dns_monitoring_ports values like 5353 or 8053 are ignored on the eBPF path. On Linux kernels using the default eBPF socket filter path, DNS traffic on configured non-53 ports will now be dropped, leading to missing reverse-DNS data and DNS stats even when the user has explicitly configured those ports.

Useful? React with 👍 / 👎.

return 0;
}

return 0;
return -1;
}

char _license[] SEC("license") = "GPL";
Loading