- The canonical domain name was not taken from the CNAME RRSet in
zone, but from the one synthetized from the wildcard. This caused
the node's owner to be different than the CNAME name.
- Added the case causing the cycling in to the example.com zone.
fixes#1313 @1h30m
- Infinite loop replaced by several labels and gotos.
- This fixed problems with CNAME resolving related to closest
enclosers saved in dname.node.
- Fixed DNSKEY adding - was not checking if the RRSet is there.
TODO: Try to refactor the answering code
TODO: Simplify DNSSEC records adding by marking the zone as signed
/ unsigned.
fixes#640
When processing DNAME, the actual qname should be used instead of
the one from the query (e.g. when after CNAME).
Saving the actual qname before stripping and using it in DNAME and
wildcard processing.
There are probably multiple bugs, needs a lot of testing and
revision of the algorithm.
However, it should mirror the current state of the flowchart
(230910-my).
Empty non-terminals are created after creating the zone list and
before inserting into ZDS. The algorithm is quite straightforward
- for each node it finds a 'parent' node and creates all nodes
'missing' between the parent and the node. Search for parent
optimized by saving the last parent + jumping directly to zone
apex if number of common labes is equal to size of the zone
apex' owner name.
Added function zn_is_empty().
Skipping empty nodes when processing non-authoritative nodes.
Changed answering algorithm so that DNAME is checked before
wildcard and zone apex.
(See query-processing-flowchart-200910-2.png.)
Implemented CNAME from DNAME synthesis - quite dumb, with a lot of
copying (because of ldns).
GLUEs found in authoritative data are extracted, those found in
other delegations are ignored (out-of-bailiwick).
Adjusting of zone node ends after it finds CNAME or delegation.
Zone adjustments now add A/AAAA references for SRV records.
Nameserver adds these records to Additional section.
Modified zone node flags (now 16 bit).
ns_put_glues() now copies the glues one by one and if a wildcard
is encountered, the RR is copied and owner is replaced by name
found by searching through the NS RRs in Authority section.
(This approach should be faster than using the zn_get_glue()
method for each name and type as in that case we would need to
always iterate through the Authority section and in each
iteration iterate over the glue records.)
zn_get_glue() now processes wildcard glue records. (The function
however is not used right now.)
Fix in zdb_process_nonauth() (should not free the list of names).
Changed zdb_dname_list_contains() to zdb_dname_list_find() which
returns the found name. Not utilized now. (May change back later)
Function ns_follow_cname() generalized to put RRs to given section.
Once again putting RRSets to packet separated into generic function
ns_put_rrset(), now with wildcard processing.
ns_put_additional() now puts all additional RRSets into the packet,
not only for given type (either way was iterating through the
whole Answer section).
ns_put_additional() now processes CNAMEs.
zdb_adjust_additional() now saves also pointer to node with CNAME
record, to be used in answering.
Structure zn_ar_rrsets modified to be able to hold pointer to CNAME
node. TODO: consider using union to save space.
Added zn_add_ref_cname() to add CNAME additional reference.
TODO: is copy-pasted from zn_add_ref(), consider refactoring.
Was not marking the node as CNAME if the canonical name node was
not present.
Was not copying the last CNAME record in chain if the next
canonical name was not present.
Query processing changed to accomodate proper wildcard processing
(see the new flowchart). Used one ugly goto, but cannot think
about any workaround right now.
If a wildcard is encountered when getting answers (or resolving
CNAME chain), the corresponding RRs are now copied into the
response packet and saved to a list of copied RRs for further
deallocation.
Removed ns_put_rrset(), as in case of answers we needed to perform
the wildcard checks.
Fix: Freeing of the copied qname in ns_answer().
zdb_create_list() was inserting the nodes in reverse order
(ldns_rr_list_pop_rrset() pops LAST RRSet, not first!).
Empty response was used for responding to all queries, though
it lacked data copied from the query. Now copies ID, Question,
and RD bit if a query is given.
Added a lot of debug ouput in zdb.
Added delegation point and glue A records to example zone file.
ns_create_response() divided into ns_create_empty_response()
(empty response may be used as an error response) and
ns_fill_response().
Added another sample zone as ldns had problems parsing the bogus25
zone.