]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
adjusting: use zone_contents_find_node_or_wildcard for additionals discovery
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 6 Feb 2019 12:31:11 +0000 (13:31 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 6 Feb 2019 16:02:01 +0000 (17:02 +0100)
src/knot/zone/adjust.c

index 6d9f4c72511b13cfa92a82100b6bfa5605bedfc4..d6afafc2dfd4fb2d6859f51d79d91bab9de331c3 100644 (file)
@@ -135,18 +135,9 @@ static int discover_additionals(const knot_dname_t *owner, struct rr_data *rr_da
        for (uint16_t i = 0; i < rdcount; i++) {
                knot_rdata_t *rdata = knot_rdataset_at(rrs, i);
                const knot_dname_t *dname = knot_rdata_name(rdata, rr_data->type);
-               const zone_node_t *node = NULL, *encloser = NULL;
-
-               /* Try to find node for the dname in the RDATA. */
-               zone_contents_find_dname(zone, dname, &node, &encloser, NULL);
-               if (node == NULL && encloser != NULL
-                   && (encloser->flags & NODE_FLAGS_WILDCARD_CHILD)) {
-                       /* Find wildcard child in the zone. */
-                       node = zone_contents_find_wildcard_child(zone, encloser);
-                       assert(node != NULL);
-               }
+               const zone_node_t *node = NULL;
 
-               if (node == NULL) {
+               if (!zone_contents_find_node_or_wildcard(zone, dname, &node)) {
                        continue;
                }