This commit is contained in:
gbucchino 2025-01-29 15:05:09 +01:00
parent b57efa5cad
commit 6aa1eed6ee
4 changed files with 123141 additions and 69923 deletions

BIN
dns-trace

Binary file not shown.

@ -126,7 +126,7 @@ static unsigned int get_answer(struct __sk_buff *skb, struct event *s_event, siz
if(bpf_skb_load_bytes(skb, tlen, &buf, 2) < 0)
return 0;
bpf_printk("tlen: %d", tlen);
tlen += 2;
tlen += 4; // For the message compression
/*
* According to the RFC 1035 (https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.4)
* In the section 4.1.4, message compression, the first two bits are set at 11 (0xc),
@ -156,7 +156,7 @@ static unsigned int get_answer(struct __sk_buff *skb, struct event *s_event, siz
return 0;
if(bpf_skb_load_bytes(skb, tlen, s_event->buf + offset, sizeof(uint16_t)) < 0)
return 0;
tlen += 4;
tlen += 2;
// Get ttl
if(bpf_skb_load_bytes(skb, tlen, s_event->buf + offset, sizeof(uint32_t)) < 0)

Binary file not shown.

193060
src/vmlinux.h

File diff suppressed because it is too large Load Diff