google / google/gopacket

DNS: can't parse query=ANY to layers.DNS

Open
#1,078 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I'm using gopacket to parse DNS packets arriving from eBPF and I noticed that when doing something like:

```
$ nslookup -type=any example.com
```

The following code does not work:

![image](https://user-images.githubusercontent.com/7395852/205319801-a391b6e6-877b-46b6-9f03-e82690f05751.png)

and the reason is that `layer7`, coming from `packet.ApplicationLayer()`, isn't recognized as type `(*layers.DNS)`, as showed by `TypeOf()`:

```
l7 type:
l7 type:
l7 type:
l7 type: *gopacket.Payload
l7 type:
l7 type: *gopacket.Payload
l7 type:
l7 type:
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.