Skip to content
Snippets Groups Projects
  1. Aug 19, 2010
    • Lubos Slovak's avatar
      Glue wildcard records processing. · 9db6920b
      Lubos Slovak authored
      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)
      9db6920b
    • Lubos Slovak's avatar
      CNAME following in Additional section. · b893312e
      Lubos Slovak authored
      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.
      b893312e
    • Lubos Slovak's avatar
      Bugfixes + wildcard nodes used when adjusting zone · b160d488
      Lubos Slovak authored
      Fix: CNAME following was processing even the last (canonical name)
           node.
      Fix: ns_put_answer() was completely omitting answers when they're
           not wildcards.
      
      zdb_find_name_in_list() edited to accept also wildcard nodes.
      b160d488
    • Lubos Slovak's avatar
      Changes in CNAME adjusting and resolving. · 5a51c422
      Lubos Slovak authored
      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.
      5a51c422
  2. Aug 18, 2010
    • Lubos Slovak's avatar
      Probably all other memory leaks fixed. · d1bfc563
      Lubos Slovak authored
      Not freeing the * domain name when creating wildcard name.
      Not freeing the packet wire format data returned by
        ldns_pkt2wire() in ns_response_to_wire().
      Not freeing the ldns_pkt structure when creating error packet in
        ns_create().
      d1bfc563
    • Lubos Slovak's avatar
      Memory leak fixed. · 0fb2c7ca
      Lubos Slovak authored
      The copied question section in ns_create_empty_response() was
        never deallocated. Now the question section is not copied.
      0fb2c7ca
    • Lubos Slovak's avatar
      Minor bugfixes. · c7465c09
      Lubos Slovak authored
      ns_create_empty_response() was copying the question RR list, but
        this was never deallocated.
      ns_follow_cname() saved the RR to the list of copied RRs even if it
        was not copied.
      Freeing of the created wildcard name in ns_answer().
      
      BUG: still major memory leaks present!!!
      c7465c09
    • Lubos Slovak's avatar
      Wildcard processing in ANSWER section. · 97e7dcdf
      Lubos Slovak authored
      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().
      97e7dcdf
    • Lubos Slovak's avatar
      Additional section processing improvements. · 0d2b3c34
      Lubos Slovak authored
      Now adding additional A/AAAA records for NS and MX records in
        answer section.
      Rewritten ns_put_additional() - now puts only the desired records.
      Zone node API for saving and getting node references cleaned up:
       - zn_add_ref_*() and zn_get_ref_*() replaced by generic functions
         zn_add_ref() and zn_get_refs().
       - redundant union members ns and mx replaced by generic member
         additional.
      0d2b3c34
    • Lubos Slovak's avatar
      MX additional records code refactoring. · 5cc7bb69
      Lubos Slovak authored
      zdb_adjust_mx() converted to generic zdb_adjust_additional().
      Fixed typo in zn_add_ref_ns().
      5cc7bb69
  3. Aug 17, 2010
  4. Aug 13, 2010
    • Lubos Slovak's avatar
      Bugfix - ns_answer_request() deleting zone data. · 2b38198a
      Lubos Slovak authored
      The response packet is filled with not-copied RRs, so we must
        free only the packet structure, not all RRs within it.
      (ldns_pkt_free() actually does deep free - should change!)
      
      Fixed delegation point adjusting (now was skipping the first
        non-auth node :-)
      2b38198a
    • Lubos Slovak's avatar
      Fixed CNAME and delegation point adjusting. · 7c3335d4
      Lubos Slovak authored
      CNAME adjusting function was searching for the canonical name in
        zone data structure, where the nodes may not be inserted yet.
      Deleg. point adjusting was causing the next node in list after
        non-auth to be skipped.
      Fixed some assertions.
      
      WARNING: BUG still present, but seems that extracting authority
               RRSet is causing the problems.
      7c3335d4
    • Lubos Slovak's avatar
      Zone adjusting in zdb_insert_name(). · a9281439
      Lubos Slovak authored
      Improved zdb_insert_node_to_zone():
       - inserting into empty zone (must be SOA, checks if owner is
         the same as zone name)
       - checks if the node is not non-authoritative (subdomain of some
         delegation point), or delegation point (contains NS).
      Some code from zdb_adjust_delegation_point() separated to
        zdb_extract_ns() and zdb_process_nonauth() (used elsewhere).
      
      Added function zn_print_rrset().
      
      WARNING: There's a BUG which somehow causes the data in zone nodes
               to be rewritten by data from the query!!
      a9281439
  5. Aug 12, 2010
    • Lubos Slovak's avatar
      Zone adjusting (CNAMEs and glue RRs). · 48c7b9a2
      Lubos Slovak authored
      Zone database:
      Added functions
       - zdb_adjust_cname() - saves pointer to the node where the CNAME
           record points.
       - zdb_adjust_delegation_point() - marks node as delegation point,
           processes all its 'children', marks them as non authoritative
           and extracts all glue records from them.
       - zdb_adjust_zone() - uses the previous two functions to adjust
           all nodes in the zone.
      zdb_insert_name() modified to properly insert the node in its
        place.
      zdb_add_zone() modified to adjust the zone after creating.
      zdb_insert_nodes_into_zds() modified not to insert non
        authoritative nodes into the zone data structure.
      
      Zone node:
      New flag for zone node - 2 - if non-authoritative.
        (+ setter and getter)
      Glue list is now ldns_rr_list.
      zn_get_glue() changed to accept desired owner name.
      Added zn_get_glues() to get all glue records from the node.
      Added zn_push_glue() to add glue records to the node. The function
        also sorts the glue records on each call.
      
      Nameserver:
      Glue records adding slightly modified (inserting all glue RRs
        by default, should change in future).
      48c7b9a2
    • Lubos Slovak's avatar
      Adding authority NS RRSet to answers. · dcabdaf6
      Lubos Slovak authored
      dcabdaf6
    • Lubos Slovak's avatar
      Nameserver answering improvements ctd. · 102a9e48
      Lubos Slovak authored
      Name server:
       - Referral responses.
       - SOA RRSet to response if name not found in zone.
       - Added some helper functions to keep the code more or less clean.
      
      Zone node:
       - cname pointer replaced by union of cname pointer and glue list
         pointer,
       - changed functions accordingly, added getters for cname node and
         glue records.
      102a9e48
    • Lubos Slovak's avatar
      Nameserver answering + changes to zn and zdb. · 468e2e57
      Lubos Slovak authored
      Added functions:
        - ns_get_zone_for_qname() which returns proper zone for searching
          (special handling of DS queries),
        - ns_find_node_in_zone() which repeatedly strips leftmost label
          from the QNAME and searches in the zone,
        - ns_follow_cname() which resolves the CNAME chain and puts all
          CNAME records to the response packet,
        - ns_copy_answers() which puts the appropriate RRSet from a node
          to the response packet.
      
      Improved the ns_answer() function. Some cases remain TODO:
        - referral
        - adding SOA when name not found in zone
        - DNAME
        - wildcard
      
      zdb_find_zone_for_name() made public and zdb_find_name() changed
        to zdb_find_name_in_zone().
      Sorting of zones in zone database in reverse canonical order
        (added function zdb_insert_zone() taking care of this).
      
      Added members to zn_node:
        - flags
        - CNAME pointer
      Added functions to zone node to get/set delegation point flag and
        to check if the node has CNAME.
      468e2e57
  6. Aug 10, 2010
    • Lubos Slovak's avatar
      Code refactoring. · cc0e08d6
      Lubos Slovak authored
      cc0e08d6
    • Lubos Slovak's avatar
      Fixed zone node list in zdb and empty response. · dbfb8440
      Lubos Slovak authored
      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.
      dbfb8440
  7. Aug 09, 2010
    • Lubos Slovak's avatar
      Nameserver improvements. · 9d6409e5
      Lubos Slovak authored
      Added members to ns_nameserver structure to keep pre-arranged
        error response in wire format and functions for using this
        response with proper rcode.
      Nameserver now replies always with a correct reply, except for
        when the query is less than 2 bytes, so the ID cannot be copied.
      9d6409e5
    • Lubos Slovak's avatar
      Removed usage of dns-simple. · 5918bd50
      Lubos Slovak authored
      Removed 3rd parameter of zdb_insert_name() - not used.
      Removed all usage of dns-simple from zone parser.
      
      Last usage of dns-simple remains in cuckoo-test (TODO: remove).
      5918bd50
    • Lubos Slovak's avatar
      8b853d75
    • Lubos Slovak's avatar
      ns_answer_request() returning error response. · 7d7fc023
      Lubos Slovak authored
      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.
      7d7fc023
    • Lubos Slovak's avatar
      Fixed zdb_add_zone(). · 00fabb98
      Lubos Slovak authored
      Now properly deleting the structures when adding fails.
      Changed return value of zdb_insert_name() when the zone was not
        found (from 1 to -2).
      00fabb98
  8. Aug 06, 2010
    • Lubos Slovak's avatar
      Zone parser now parses BIND zone files. · d549bb38
      Lubos Slovak authored
      Added function zp_parse_zonefile_bind().
      Changed the sample file to provide owner name for the SOA as
        no origin is given.
      d549bb38
    • Lubos Slovak's avatar
      Major changes to zone database. · c851b8c1
      Lubos Slovak authored
      Each zone now holds a linked list of all its nodes while these
        are at the same time in the main zone data structure.
        => added pointer to the zone apex to zdb_zone
        => added function zdb_add_zone() to add a zone in ldns_zone
           format to the database.
      Note: zdb_insert() does nothing with the given node, so it should
            be used only with nodes already in the list.
      TODO: Some way to add a new node to the zone should be provided.
      
      Added owner name and pointers to next and previous item in list
        to the zone node structure + added function zn_owner() for
        getting the node's owner.
      
      Changed API of zone-data-structure: zds_insert() now has only 2
        arguments - the owner is in the node.
      c851b8c1
    • Lubos Slovak's avatar
      Minor changes. · 6edad31e
      Lubos Slovak authored
      Added function for checking skip list emptiness.
      Checking ldns_status returned from ldns_pkt2wire() in
        ns_answer_request().
      Casting buffers to unsigned char * in call to ns_answer_request().
      6edad31e
    • Lubos Slovak's avatar
      Modified nameserver to use ldns. · 8da78e95
      Lubos Slovak authored
      Changed nameserver's API - function ns_answer_request() to conform
        the ldns type usage.
      8da78e95
  9. Aug 05, 2010
    • Lubos Slovak's avatar
      Modified zds and zdb to use ldns. · f1f98612
      Lubos Slovak authored
      Zone data structure module now uses ldns structures in the API.
      Zone database module now uses ldns structures in the API and
        implementation.
      Zone parser and name server modules' iplementation slightly
        modified to be able to call zds and zdb functions.
      Minor fixes in dns-simple.
      f1f98612
    • Lubos Slovak's avatar
      Added dns-utils for functions not found in ldns. · 13d67361
      Lubos Slovak authored
      Currently only a function for matching labels in two domain names
        is implemented. May need some revision and testing!
      13d67361
  10. Aug 04, 2010
    • Lubos Slovak's avatar
      Zone node modified to use ldns. Not functional now · 1144fbde
      Lubos Slovak authored
      Some other functions had to be modified in order to be able to
        compile the program. However, it is not debugged, and currently
        does not work.
      1144fbde
    • Lubos Slovak's avatar
      Modifications & bugfix in skip list. · 508f6c3e
      Lubos Slovak authored
      Functions for merging values and printing items removed from the
        skip list structure. Now passed only to appropriate functions.
      Bugfix in skip_remove() - was not testing the node pointer for
        NULL.
      508f6c3e
    • Lubos Slovak's avatar
      Skip list modifications and test. · c264f9d7
      Lubos Slovak authored
      Added functions
        skip_delete_node for properly deleting skip_node
        skip_destroy_list for properly destroying whole skip list
        skip_print_list for printing the skip list.
      
      Changed return values of function skip_insert().
      Renamed skip_delete() to skip_remove() and changed return value
        to int (successful / not found)
      Bugfix in skip_remove().
      
      Added test of skip list.
      c264f9d7
  11. Aug 03, 2010
Loading