diff --git a/tdns/dns-storage.hh b/tdns/dns-storage.hh index a98efab..c4d79e9 100644 --- a/tdns/dns-storage.hh +++ b/tdns/dns-storage.hh @@ -84,7 +84,10 @@ struct DNSName auto size() { return d_name.size(); } void clear() { d_name.clear(); } bool makeRelative(const DNSName& root); - + bool operator==(const DNSName& rhs) const + { + return std::lexicographical_compare(begin(), end(), rhs.begin(), rhs.end())==0; + } std::deque d_name; }; diff --git a/tdns/tests.cc b/tdns/tests.cc index d6d477d..e5a2184 100644 --- a/tdns/tests.cc +++ b/tdns/tests.cc @@ -28,3 +28,15 @@ TEST_CASE( "DNSName escaping", "[escapes]" ) { str<