diff options
| author | Shulhan <ms@kilabit.info> | 2018-09-19 05:22:32 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-09-19 05:22:32 +0700 |
| commit | 449678df29018f845a0eadeba3948bbc8eed116d (patch) | |
| tree | cbdc04d71af67d08b8eb5f4b802dc5f06db59212 | |
| parent | 1cae4ca316afa5d177fdbf7a98a0ec7fffe76a3e (diff) | |
| download | pakakeh.go-449678df29018f845a0eadeba3948bbc8eed116d.tar.xz | |
lib/dns: set default new message header and question
On header, set the query count to 1; on question set type to "A" and
class to "IN".
| -rw-r--r-- | lib/dns/message.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/dns/message.go b/lib/dns/message.go index c5d9f770..691cc044 100644 --- a/lib/dns/message.go +++ b/lib/dns/message.go @@ -73,8 +73,12 @@ func NewMessage() *Message { Header: &SectionHeader{ IsQuery: true, IsRD: true, + QDCount: 1, + }, + Question: &SectionQuestion{ + Type: QueryTypeA, + Class: QueryClassIN, }, - Question: &SectionQuestion{}, Packet: make([]byte, maxUDPPacketSize), dnameOff: make(map[string]uint16), } |
