Skip to content

Commit

Permalink
Fix #17: Save EDNS information when it's found
Browse files Browse the repository at this point in the history
  • Loading branch information
jelu committed Jun 2, 2017
1 parent 8d50269 commit 5423c1d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/dns.h
Expand Up @@ -269,11 +269,21 @@ class DNSMessage {
m_error = offs;
return;
}

if (m_opt_rr && !m_edns0) {
m_edns0 = true;
unsigned long ttl = m_opt_rr->ttl;
m_do = (ttl >> 15) & 1;
m_extended_rcode = ttl >> 24;
m_edns_version = (ttl >> 16) & 0xff;
m_z = ttl & 0x7fff;
m_udp_size = m_opt_rr->rr_class;
}
}
if (offs > m_length)
m_error = offs;

if (m_opt_rr) {
if (m_opt_rr && !m_edns0) {
m_edns0 = true;
unsigned long ttl = m_opt_rr->ttl;
m_do = (ttl >> 15) & 1;
Expand Down

0 comments on commit 5423c1d

Please sign in to comment.