fix(dnstap): store IPv4-mapped IPv6 addresses as 4 octets with SocketFamily INET (#8186)

Signed-off-by: Jaime Hablutzel <hablutzel1@gmail.com>
This commit is contained in:
Jaime Hablutzel
2026-06-25 17:49:32 -05:00
committed by GitHub
parent d0e0d92fa4
commit 1936a2bb40
3 changed files with 111 additions and 20 deletions

View File

@@ -123,8 +123,9 @@ func testMessage() *tap.Message {
return &tap.Message{
SocketFamily: &inet,
SocketProtocol: &udp,
QueryAddress: net.ParseIP("10.240.0.1"),
QueryPort: &port,
// Explicit 4-octet form, because that's the expected dnstap message representation when SocketFamily is INET.
QueryAddress: net.ParseIP("10.240.0.1").To4(),
QueryPort: &port,
}
}