Commit 3f75c37c authored by Filip Široký's avatar Filip Široký

semantic-check: fix duplicate and invalid check and add test

parent 10a12c7a
......@@ -1044,18 +1044,9 @@ static int check_cname_multiple(const zone_node_t *node, semchecks_data_t *data)
*/
static int check_dname(const zone_node_t *node, semchecks_data_t *data)
{
const knot_rdataset_t *dname_rrs = node_rdataset(node, KNOT_RRTYPE_DNAME);
if (dname_rrs != NULL && node->children != 0) {
data->handler->fatal_error = true;
data->handler->cb(data->handler, data->zone, node,
ZC_ERR_DNAME_CHILDREN, NULL);
}
if (node->parent != NULL && node_rrtype_exists(node->parent, KNOT_RRTYPE_DNAME)) {
data->handler->fatal_error = true;
data->handler->cb(data->handler, data->zone, node,
ZC_ERR_DNAME_CHILDREN, "(occluded by a parent DNAME)");
data->handler->cb(data->handler, data->zone, node, ZC_ERR_DNAME_CHILDREN, NULL);
}
return KNOT_EOK;
......
;; Zone dump (Knot DNS 2.6.0)
example.com. 3600 SOA dns1.com. hostmaster.com. 2010111216 21600 3600 604800 86400
example.com. 3600 NS dns1.com.
example.com. 3600 DNAME bar.example.com.
example.com. 0 CDNSKEY 257 3 13 p3J5T0YFTf9IGjHFhS5oFGGBDOjs25Tz29eT5sAK7WxXoapa4Vw3C9zBH/BdDH1RmeUR6OHPY1+x2NiouNm05g==
example.com. 0 CDS 2073 13 2 B345AF792A41656301EC57A4CE7E03C02A5E3C8F422FAB2FCD67C25649DB1285
example.com. 3600 DNSKEY 256 3 13 UthmrB0FXNo/yZ3N0cnG/OJxG0FR7CT6KadbK4n22rMzfwq87jnobJ0xOpC7aEpGgDbypR0rK+KIAbRv4Prfeg==
example.com. 3600 DNSKEY 257 3 13 p3J5T0YFTf9IGjHFhS5oFGGBDOjs25Tz29eT5sAK7WxXoapa4Vw3C9zBH/BdDH1RmeUR6OHPY1+x2NiouNm05g==
example.com. 0 NSEC3PARAM 1 0 10 90E4D95759B9FB50
;; DNSSEC signatures
example.com. 3600 RRSIG NS 13 2 3600 20670924135857 20171006122857 46856 example.com. I2YeGSYvj56eHe7bkbnOpziu18gAdwMGEH5ZAGiuZzL37M2lRB/2rtAxWpxP1G1+idFXahAx6q2X5pK1o/yZWQ==
example.com. 3600 RRSIG SOA 13 2 3600 20670924135857 20171006122857 46856 example.com. NULugLRW6r+y6AAJS2tcFt5BBWJMMxq3q0wvYirSvzzt5A6vwWC2ocJ2A2kftoDrIQWYHl1ppsxHTMsvw3NKfQ==
example.com. 3600 RRSIG DNAME 13 2 3600 20670924135857 20171006122857 46856 example.com. PhUAnuLYFE3ySc9mMoExr+WoGf6it4/571GhjYyhgfUWQs1pE8WJismYG9NFle6Q3OlmDJSEWQwHBHxQmOeyKw==
example.com. 3600 RRSIG DNSKEY 13 2 3600 20670924135857 20171006122857 2073 example.com. ZnhiPDiX/3RUW5rdLO8pKcIe+orbYloDD1mxhmfvfJ52IGdCV+okDu2M559pUB8Ihb/6H9DDl1qO5lTVGpVEMg==
example.com. 0 RRSIG NSEC3PARAM 13 2 0 20670924135857 20171006122857 46856 example.com. DxyzDQGkONU+NTxBswKZRWc3kPQxH929PaD5S4g6MoH6EJ/X52mb5om0oXpXLuOTEo2Cij8c3aghLN2h3eiw5Q==
example.com. 0 RRSIG CDS 13 2 0 20670924135857 20171006122857 46856 example.com. 8tPTolSZPvZUSpIs+nb4x/QRrNFgZG0jqqWWnQH8zy3CRS4L91SU5Z08aVz632n35toWv+uqG8LXI0sLKm6M4g==
example.com. 0 RRSIG CDNSKEY 13 2 0 20670924135857 20171006122857 46856 example.com. 80MTgMHXqc8Eb+3LPjl9fJ6sjNR40MPVKUfD/Qw0mzWHjz8ZOUDxNZViHnmyoz4JoorrO5b2yAx+ojpt+FyQLg==
;; DNSSEC NSEC3 chain
9sq7g935u0bb7md3rn34uh1aknnjhf1k.example.com. 86400 NSEC3 1 0 10 90E4D95759B9FB50 9SQ7G935U0BB7MD3RN34UH1AKNNJHF1K NS SOA DNAME RRSIG DNSKEY NSEC3PARAM CDS CDNSKEY
;; DNSSEC NSEC3 signatures
9sq7g935u0bb7md3rn34uh1aknnjhf1k.example.com. 86400 RRSIG NSEC3 13 3 86400 20670924135857 20171006122857 46856 example.com. sFlwNYgq6HoBDlXp9vC0Ck5uJ76rJyf4zfdQmTnJ8aB/44XvDoQ+tGIn4ilVN2SxzyT1A4c/nWOyMMCVhjXARg==
;; Written 17 records
;; Time 2017-10-06 15:58:57 CEST
......@@ -81,8 +81,7 @@ plan_lazy
expect_error "cname_extra_01.zone" 1 1 "$CNAME_EXTRA_RECORDS"
expect_error "cname_extra_02.signed" 1 1 "$CNAME_EXTRA_RECORDS"
expect_error "cname_multiple.zone" 1 1 "$CNAME_MULTIPLE"
expect_error "dname_children.zone" 1 1 "$DNAME_CHILDREN \(occluded by a parent DNAME\)"
expect_error "dname_children.zone" 1 2 "$DNAME_CHILDREN"
expect_error "dname_children.zone" 1 1 "$DNAME_CHILDREN"
expect_error "missing_ns.zone" 0 1 "$MISSING_NS_DEL_POINT"
expect_error "missing_glue_01.zone" 0 2 "$GLUE_RECORD"
......@@ -130,5 +129,6 @@ test_correct "no_error_nsec3_delegation.signed"
test_correct "no_error_nsec3_optout.signed"
test_correct "no_error_wildcard_glue.zone"
test_correct "cdnskey.cds"
test_correct "dname_apex_nsec3.signed"
rm $LOG
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment