Browse Source

[trac505] Simplify length check condition

Michal 'vorner' Vaner 14 years ago
parent
commit
180015eada
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/bin/auth/query.cc

+ 2 - 4
src/bin/auth/query.cc

@@ -169,10 +169,8 @@ Query::process() const {
                     db_result.rrset->getName().getLabelCount()));
                 // If we put it together, will it be too long?
                 // (The prefix contains trailing ., which will be removed
-                if (prefix.getLength() - Name(".").getLength() +
-                    dname.getDname().getLength() > Name::MAX_WIRE ||
-                    prefix.getLabelCount() - Name(".").getLabelCount() +
-                    dname.getDname().getLabelCount() > Name::MAX_LABELS) {
+                if (prefix.getLength() - Name::ROOT_NAME().getLength() +
+                    dname.getDname().getLength() > Name::MAX_WIRE) {
                     /*
                      * In case the synthesized name is too long, section 4.1
                      * of RFC 2672 mandates we return YXDOMAIN.