Closed tertsdiepraam closed 5 months ago
The answer sections can contain other records (even legitimately, any possible CNAME records go there), so using the ANCOUNT can be wrong. Which also means that the is_empty
impl in FoundHosts
is potentially wrong and should be removed.
We could impl methods based on using self.iter()
, but given that isn’t exactly free, maybe we shouldn’t hide the O(n)-ness.
I noticed that
FoundAddrs
did not have anis_empty
method while implementing thelookup
command fordnsi
. I also figured thatlen
methods forFoundHosts
andFoundAddrs
would be a nice addition.I just kind of guessed the implementation of these methods, so I don't really know whether they are correct :)