If the node we are about to insert already existed as an intermediary
one, we need to mark it as an end node.
endNode=true;
}
else if(labels.size()==1) {
- children.insert(SuffixMatchNode(*labels.begin(), true));
+ auto res=children.insert(SuffixMatchNode(*labels.begin(), true));
+ if(!res.second) {
+ if(!res.first->endNode) {
+ res.first->endNode = true;
+ }
+ }
}
else {
auto res=children.insert(SuffixMatchNode(*labels.rbegin(), false));
smn.add(g_rootdnsname); // block the root
BOOST_CHECK(smn.check(DNSName("a.root-servers.net.")));
+
+ DNSName examplenet("example.net.");
+ DNSName net("net.");
+ smn.add(examplenet);
+ smn.add(net);
+ BOOST_CHECK(smn.check(examplenet));
+ BOOST_CHECK(smn.check(net));
}