Skip to content
Snippets Groups Projects
Commit ffaf5a1d authored by Jan Kadlec's avatar Jan Kadlec
Browse files

new_node: Fixed rrset initializations.

parent b4419496
No related merge requests found
...@@ -801,11 +801,13 @@ void knot_node_fill_rrset(const knot_node_t *node, uint16_t type, ...@@ -801,11 +801,13 @@ void knot_node_fill_rrset(const knot_node_t *node, uint16_t type,
for (uint i = 0; i < node->rrset_count; ++i) { for (uint i = 0; i < node->rrset_count; ++i) {
hit = node->rrs[i].type == type; hit = node->rrs[i].type == type;
if (hit) { if (hit) {
struct rr_data *rr_data = &node->rrs[i];
rrset->owner = node->owner; rrset->owner = node->owner;
rrset->type = type; rrset->type = type;
rrset->rclass = KNOT_CLASS_IN; rrset->rclass = KNOT_CLASS_IN;
rrset->rrs = node->rrs[i].rrs; rrset->rrs = rr_data->rrs;
rrset->additional = node->rrs->additional; rrset->additional = rr_data->additional;
return;
} }
} }
if (!hit) { if (!hit) {
......
...@@ -745,6 +745,7 @@ int knot_pkt_parse_rr(knot_pkt_t *pkt, unsigned flags) ...@@ -745,6 +745,7 @@ int knot_pkt_parse_rr(knot_pkt_t *pkt, unsigned flags)
/* Parse wire format. */ /* Parse wire format. */
size_t rr_size = pkt->parsed; size_t rr_size = pkt->parsed;
knot_rrset_t *rr = &pkt->rr[pkt->rrset_count]; knot_rrset_t *rr = &pkt->rr[pkt->rrset_count];
knot_rrs_init(&rr->rrs);
ret = knot_pkt_rr_from_wire(pkt->wire, &pkt->parsed, pkt->max_size, ret = knot_pkt_rr_from_wire(pkt->wire, &pkt->parsed, pkt->max_size,
&pkt->mm, rr); &pkt->mm, rr);
if (ret != KNOT_EOK) { if (ret != KNOT_EOK) {
......
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