Checking whether the SOA record is in the right section was broken
because of a misplaced parenthesis, and the unit test checking that
case turned out to be broken too (wrong class) :'(
The broken check was reported by cppcheck (thanks!):
```
Comparison of a boolean expression with an integer.
```
}
/* report it if we see a SOA record in the AUTHORITY section */
- if(dnstype == QType::SOA && dnsclass == QClass::IN && seenAuthSOA != nullptr && n >= (ntohs(dh->ancount) && n < (ntohs(dh->ancount) + ntohs(dh->nscount)))) {
+ if(dnstype == QType::SOA && dnsclass == QClass::IN && seenAuthSOA != nullptr && n >= ntohs(dh->ancount) && n < (ntohs(dh->ancount) + ntohs(dh->nscount))) {
*seenAuthSOA = true;
}
pwR.getHeader()->qr = 1;
pwR.commit();
- pwR.startRecord(name, QType::SOA, 255, QClass::CHAOS, DNSResourceRecord::ADDITIONAL);
+ pwR.startRecord(name, QType::SOA, 255, QClass::IN, DNSResourceRecord::ADDITIONAL);
pwR.commit();
bool seenAuthSOA = false;