Commit ab1ddf79 authored by Jan Kadlec's avatar Jan Kadlec

new_node: removed obsolete RRSet getters

parent 2707c40b
......@@ -119,7 +119,7 @@ void help(void)
static int cmd_remote_print_reply(const knot_rrset_t *rr)
{
/* Process first RRSet in data section. */
if (knot_rrset_type(rr) != KNOT_RRTYPE_TXT) {
if (rr->type != KNOT_RRTYPE_TXT) {
return KNOT_EMALF;
}
......
......@@ -94,7 +94,7 @@ static int remote_rdata_apply(server_t *s, remote_cmdargs_t* a, remote_zonef_t *
for (unsigned i = 0; i < a->argc; ++i) {
/* Process all zones in data section. */
const knot_rrset_t *rr = &a->arg[i];
if (knot_rrset_type(rr) != KNOT_RRTYPE_NS) {
if (rr->type != KNOT_RRTYPE_NS) {
continue;
}
......@@ -532,7 +532,7 @@ static void log_command(const char *cmd, const remote_cmdargs_t* args)
for (unsigned i = 0; i < args->argc; i++) {
const knot_rrset_t *rr = &args->arg[i];
if (knot_rrset_type(rr) != KNOT_RRTYPE_NS) {
if (rr->type != KNOT_RRTYPE_NS) {
continue;
}
......
......@@ -128,9 +128,9 @@ static int mark_nsec3(knot_rrset_t *rrset, void *data)
knot_node_t *node = NULL;
int ret;
if (knot_rrset_type(rrset) == KNOT_RRTYPE_NSEC3) {
if (rrset->type == KNOT_RRTYPE_NSEC3) {
// Find the name in the NSEC3 tree and mark the node
ret = knot_zone_tree_get(nsec3s, knot_rrset_owner(rrset),
ret = knot_zone_tree_get(nsec3s, rrset->owner,
&node);
if (ret != KNOT_EOK) {
return ret;
......
......@@ -1483,8 +1483,8 @@ int knot_zone_sign_rr_should_be_signed(const knot_node_t *node,
// These RRs have their signatures stored in changeset already
if (knot_node_is_removed_nsec(node)
&& ((knot_rrset_type(rrset) == KNOT_RRTYPE_NSEC)
|| (knot_rrset_type(rrset) == KNOT_RRTYPE_NSEC3))) {
&& ((rrset->type == KNOT_RRTYPE_NSEC)
|| (rrset->type == KNOT_RRTYPE_NSEC3))) {
return KNOT_EOK;
}
......
......@@ -71,7 +71,7 @@ static int dname_cname_synth(const knot_rrset_t *dname_rr,
knot_rrs_init(&cname_rrset->rrs);
/* Replace last labels of qname with DNAME. */
const knot_dname_t *dname_wire = knot_rrset_owner(dname_rr);
const knot_dname_t *dname_wire = dname_rr->owner;
const knot_dname_t *dname_tgt = knot_rrs_dname_target(&dname_rr->rrs);
int labels = knot_dname_labels(dname_wire, NULL);
knot_dname_t *cname = knot_dname_replace_suffix(qname, labels, dname_tgt);
......@@ -101,7 +101,7 @@ static int dname_cname_synth(const knot_rrset_t *dname_rr,
static bool dname_cname_cannot_synth(const knot_rrset_t *rrset, const knot_dname_t *qname)
{
if (knot_dname_labels(qname, NULL)
- knot_dname_labels(knot_rrset_owner(rrset), NULL)
- knot_dname_labels(rrset->owner, NULL)
+ knot_dname_labels(knot_rrs_dname_target(&rrset->rrs), NULL)
> KNOT_DNAME_MAXLABELS) {
return true;
......@@ -674,8 +674,8 @@ int ns_put_rr(knot_pkt_t *pkt, knot_rrset_t *rr,
{
/* RFC3123 s.6 - empty APL is valid, ignore other empty RRs. */
if (knot_rrset_rr_count(rr) < 1 &&
knot_rrset_type(rr) != KNOT_RRTYPE_APL) {
dbg_ns("%s: refusing to put empty RR of type %u\n", __func__, knot_rrset_type(rr));
rr->type != KNOT_RRTYPE_APL) {
dbg_ns("%s: refusing to put empty RR of type %u\n", __func__, rr->type);
return KNOT_EMALF;
}
......
......@@ -161,7 +161,7 @@ static int ixfr_query_check(struct query_data *qdata)
/* Need SOA authority record. */
const knot_pktsection_t *authority = knot_pkt_section(qdata->query, KNOT_AUTHORITY);
const knot_rrset_t *their_soa = &authority->rr[0];
if (authority->count < 1 || knot_rrset_type(their_soa) != KNOT_RRTYPE_SOA) {
if (authority->count < 1 || their_soa->type != KNOT_RRTYPE_SOA) {
qdata->rcode = KNOT_RCODE_FORMERR;
return NS_PROC_FAIL;
}
......
......@@ -236,7 +236,7 @@ bool process_query_acl_check(acl_t *acl, struct query_data *qdata)
/* Authenticate with NOKEY if the packet isn't signed. */
if (query->tsig_rr) {
key_name = knot_rrset_owner(query->tsig_rr);
key_name = query->tsig_rr->owner;
key_alg = tsig_rdata_alg(query->tsig_rr);
}
acl_match_t *match = acl_find(acl, query_source, key_name);
......
......@@ -95,7 +95,7 @@ int internet_notify(knot_pkt_t *pkt, struct query_data *qdata)
const knot_pktsection_t *answer = knot_pkt_section(qdata->query, KNOT_ANSWER);
if (answer->count > 0) {
const knot_rrset_t *soa = &answer->rr[0];
if (knot_rrset_type(soa) == KNOT_RRTYPE_SOA) {
if (soa->type == KNOT_RRTYPE_SOA) {
serial = knot_rrs_soa_serial(&soa->rrs);
dbg_ns("%s: received serial %u\n", __func__, serial);
} else { /* Ignore */
......
......@@ -506,8 +506,8 @@ int zones_changesets_from_binary(knot_changesets_t *chgsets)
* be set, check it.
*/
dbg_xfr_verb("xfr: reading RRSets to REMOVE, first RR is %hu\n",
knot_rrset_type(rrset));
assert(knot_rrset_type(rrset) == KNOT_RRTYPE_SOA);
rrset->type);
assert(rrset->type == KNOT_RRTYPE_SOA);
assert(chs->serial_from == knot_rrs_soa_serial(&rrset->rrs));
knot_changeset_add_soa(chs, rrset, KNOT_CHANGESET_REMOVE);
......@@ -527,7 +527,7 @@ int zones_changesets_from_binary(knot_changesets_t *chgsets)
}
/* Check for next SOA. */
if (knot_rrset_type(rrset) == KNOT_RRTYPE_SOA) {
if (rrset->type == KNOT_RRTYPE_SOA) {
/* Move to ADD section if in REMOVE. */
if (in_remove_section) {
......@@ -1767,7 +1767,7 @@ int zones_verify_tsig_query(const knot_pkt_t *query,
return KNOT_TSIG_EBADKEY;
}
const knot_dname_t *kname = knot_rrset_owner(query->tsig_rr);
const knot_dname_t *kname = query->tsig_rr->owner;
assert(kname != NULL);
/*
......
......@@ -105,6 +105,7 @@ static bool node_empty(const knot_node_t *node, const knot_changeset_t *changese
knot_rrs_clear(&node_rr.rrs, NULL);
return false;
}
knot_rrs_clear(&node_rr.rrs, NULL);
}
}
......@@ -165,14 +166,14 @@ static int knot_ddns_check_exist(const knot_zone_contents_t *zone,
assert(rrset->type != KNOT_RRTYPE_ANY);
assert(rrset->rclass == KNOT_CLASS_ANY);
if (!knot_dname_is_sub(knot_rrset_owner(rrset),
if (!knot_dname_is_sub(rrset->owner,
knot_node_owner(knot_zone_contents_apex(zone)))) {
*rcode = KNOT_RCODE_NOTZONE;
return KNOT_EOUTOFZONE;
}
const knot_node_t *node;
node = knot_zone_contents_find_node(zone, knot_rrset_owner(rrset));
node = knot_zone_contents_find_node(zone, rrset->owner);
if (node == NULL) {
*rcode = KNOT_RCODE_NXRRSET;
return KNOT_ENONODE;
......@@ -193,14 +194,14 @@ static int knot_ddns_check_exist_full(const knot_zone_contents_t *zone,
assert(rcode != NULL);
assert(rrset->type != KNOT_RRTYPE_ANY);
if (!knot_dname_is_sub(knot_rrset_owner(rrset),
if (!knot_dname_is_sub(rrset->owner,
knot_node_owner(knot_zone_contents_apex(zone)))) {
*rcode = KNOT_RCODE_NOTZONE;
return KNOT_EOUTOFZONE;
}
const knot_node_t *node;
node = knot_zone_contents_find_node(zone, knot_rrset_owner(rrset));
node = knot_zone_contents_find_node(zone, rrset->owner);
if (node == NULL) {
*rcode = KNOT_RCODE_NXRRSET;
return KNOT_EPREREQ;
......@@ -210,9 +211,9 @@ static int knot_ddns_check_exist_full(const knot_zone_contents_t *zone,
} else {
knot_rrset_t found = RRSET_INIT(node, rrset->type);
// do not have to compare the header, it is already done
assert(knot_rrset_type(&found) == rrset->type);
assert(knot_dname_cmp(knot_rrset_owner(&found),
knot_rrset_owner(rrset)) == 0);
assert((&found)->type == rrset->type);
assert(knot_dname_cmp((&found)->owner,
rrset->owner) == 0);
if (!knot_rrset_equal(&found, rrset, KNOT_RRSET_COMPARE_WHOLE)) {
*rcode = KNOT_RCODE_NXRRSET;
return KNOT_EPREREQ;
......@@ -248,7 +249,7 @@ static int knot_ddns_check_not_exist(const knot_zone_contents_t *zone,
assert(rrset->type != KNOT_RRTYPE_ANY);
assert(rrset->rclass == KNOT_CLASS_NONE);
if (!knot_dname_is_sub(knot_rrset_owner(rrset),
if (!knot_dname_is_sub(rrset->owner,
knot_node_owner(knot_zone_contents_apex(zone)))) {
*rcode = KNOT_RCODE_NOTZONE;
return KNOT_EOUTOFZONE;
......@@ -256,7 +257,7 @@ static int knot_ddns_check_not_exist(const knot_zone_contents_t *zone,
const knot_node_t *node;
node = knot_zone_contents_find_node(zone, knot_rrset_owner(rrset));
node = knot_zone_contents_find_node(zone, rrset->owner);
if (node == NULL) {
return KNOT_EOK;
} else if (!knot_node_rrtype_exists(node, rrset->type)) {
......@@ -427,7 +428,7 @@ static int knot_ddns_check_update(const knot_rrset_t *rrset,
{
/* Accept both subdomain and dname match. */
dbg_ddns("Checking UPDATE packet.\n");
const knot_dname_t *owner = knot_rrset_owner(rrset);
const knot_dname_t *owner = rrset->owner;
const knot_dname_t *qname = knot_pkt_qname(query);
int is_sub = knot_dname_is_sub(owner, qname);
if (!is_sub && knot_dname_cmp(owner, qname) != 0) {
......
......@@ -99,7 +99,7 @@ dbg_xfrin_exec(
// the SOA should be the first (and only) RRSet in the response
const knot_pktsection_t *answer = knot_pkt_section(soa_response, KNOT_ANSWER);
if (answer->count < 1 || knot_rrset_type(&answer->rr[0]) != KNOT_RRTYPE_SOA) {
if (answer->count < 1 || (&answer->rr[0])->type != KNOT_RRTYPE_SOA) {
return KNOT_EMALF;
}
......@@ -337,7 +337,7 @@ int xfrin_process_ixfr_packet(knot_pkt_t *pkt, knot_ns_xfr_t *xfr)
}
// the first RR must be a SOA
if (knot_rrset_type(rr) != KNOT_RRTYPE_SOA) {
if (rr->type != KNOT_RRTYPE_SOA) {
dbg_xfrin("First RR is not a SOA RR!\n");
ret = KNOT_EMALF;
goto cleanup;
......@@ -375,7 +375,7 @@ int xfrin_process_ixfr_packet(knot_pkt_t *pkt, knot_ns_xfr_t *xfr)
if (rr == NULL) {
dbg_xfrin("Response containing only SOA,\n");
return XFRIN_RES_SOA_ONLY;
} else if (knot_rrset_type(rr) != KNOT_RRTYPE_SOA) {
} else if (rr->type != KNOT_RRTYPE_SOA) {
dbg_xfrin("Fallback to AXFR.\n");
ret = XFRIN_RES_FALLBACK;
return ret;
......@@ -470,10 +470,10 @@ dbg_xfrin_exec_verb(
// this may be either a start of a changeset or the
// last SOA (in case the transfer was empty, but that
// is quite weird in fact
if (knot_rrset_type(rr) != KNOT_RRTYPE_SOA) {
if (rr->type != KNOT_RRTYPE_SOA) {
dbg_xfrin("First RR is not a SOA RR!\n");
dbg_xfrin_verb("RR type: %u\n",
knot_rrset_type(rr));
rr->type);
ret = KNOT_EMALF;
goto cleanup;
}
......@@ -523,7 +523,7 @@ dbg_xfrin_exec_verb(
case KNOT_CHANGESET_REMOVE:
// if the next RR is SOA, store it and change state to
// ADD
if (knot_rrset_type(rr) == KNOT_RRTYPE_SOA) {
if (rr->type == KNOT_RRTYPE_SOA) {
// we should not be here if soa_from is not set
assert(chset->soa_from != NULL);
knot_rrset_t *soa = knot_rrset_cpy(rr, NULL);
......@@ -552,7 +552,7 @@ dbg_xfrin_exec_verb(
case KNOT_CHANGESET_ADD:
// if the next RR is SOA change to state -1 and do not
// parse next RR
if (knot_rrset_type(rr) == KNOT_RRTYPE_SOA) {
if (rr->type == KNOT_RRTYPE_SOA) {
log_zone_info("%s Serial %u -> %u.\n",
xfr->msg,
knot_rrs_soa_serial(&chset->soa_from->rrs),
......
......@@ -335,14 +335,14 @@ static int check_rrsig_rdata(err_handler_t *handler,
/* Prepare additional info string. */
char info_str[50] = { '\0' };
char type_str[16] = { '\0' };
knot_rrtype_to_string(knot_rrset_type(rrset), type_str, sizeof(type_str));
knot_rrtype_to_string(rrset->type, type_str, sizeof(type_str));
int ret = snprintf(info_str, sizeof(info_str), "Record type: %s.", type_str);
if (ret < 0 || ret >= sizeof(info_str)) {
return KNOT_ENOMEM;
}
if (knot_rrs_rrsig_type_covered(rrsig, 0) !=
knot_rrset_type(rrset)) {
rrset->type) {
/* zoneparser would not let this happen
* but to be on the safe side
*/
......@@ -354,11 +354,11 @@ static int check_rrsig_rdata(err_handler_t *handler,
/* label number at the 2nd index should be same as owner's */
uint8_t labels_rdata = knot_rrs_rrsig_labels(rrsig, rr_pos);
int tmp = knot_dname_labels(knot_rrset_owner(rrset), NULL) - labels_rdata;
int tmp = knot_dname_labels(rrset->owner, NULL) - labels_rdata;
if (tmp != 0) {
/* if name has wildcard, label must not be included */
if (!knot_dname_is_wildcard(knot_rrset_owner(rrset))) {
if (!knot_dname_is_wildcard(rrset->owner)) {
err_handler_handle_error(handler, node,
ZC_ERR_RRSIG_RDATA_LABELS,
info_str);
......@@ -403,7 +403,7 @@ static int check_rrsig_rdata(err_handler_t *handler,
/* dnskey is in the apex node */
if (!knot_rrset_empty(dnskey_rrset) &&
knot_dname_cmp(signer_name, knot_rrset_owner(dnskey_rrset)) != 0
knot_dname_cmp(signer_name, dnskey_rrset->owner) != 0
) {
err_handler_handle_error(handler, node,
ZC_ERR_RRSIG_RDATA_DNSKEY_OWNER,
......@@ -473,7 +473,7 @@ static int check_rrsig_in_rrset(err_handler_t *handler,
/* Prepare additional info string. */
char info_str[50] = { '\0' };
char type_str[16] = { '\0' };
knot_rrtype_to_string(knot_rrset_type(rrset), type_str, sizeof(type_str));
knot_rrtype_to_string(rrset->type, type_str, sizeof(type_str));
int ret = snprintf(info_str, sizeof(info_str), "Record type: %s.",
type_str);
if (ret < 0 || ret >= sizeof(info_str)) {
......
......@@ -221,10 +221,11 @@ static int knot_zone_diff_rdata_return_changes(const knot_rrset_t *rrset1,
* changed/removed rdatas. This has awful computation time.
*/
/* Create fake RRSet, it will be easier to handle. */
knot_dname_t *owner_copy = knot_dname_copy(knot_rrset_get_owner(rrset1), NULL);
knot_dname_t *owner_copy = knot_dname_copy(rrset1->owner,
NULL);
*changes = knot_rrset_new(owner_copy,
knot_rrset_type(rrset1),
knot_rrset_class(rrset1),
rrset1->type,
rrset1->rclass,
NULL);
if (*changes == NULL) {
knot_dname_free(&owner_copy, NULL);
......@@ -234,7 +235,7 @@ static int knot_zone_diff_rdata_return_changes(const knot_rrset_t *rrset1,
}
const rdata_descriptor_t *desc =
get_rdata_descriptor(knot_rrset_type(rrset1));
get_rdata_descriptor(rrset1->type);
assert(desc);
uint16_t rr1_count = knot_rrset_rr_count(rrset1);
......@@ -245,7 +246,7 @@ static int knot_zone_diff_rdata_return_changes(const knot_rrset_t *rrset1,
/* No such RR is present in 'rrset2'. */
dbg_zonediff("zone_diff: diff_rdata: "
"No match for RR (type=%u owner=%p).\n",
knot_rrset_type(rrset1),
rrset1->type,
rrset1->owner);
/* We'll copy index 'i' into 'changes' RRSet. */
ret = knot_rrset_add_rr_from_rrset(*changes, rrset1, i, NULL);
......@@ -417,7 +418,7 @@ static int knot_zone_diff_node(knot_node_t **node_ptr, void *data)
if (knot_rrset_empty(&rrset_from_second_node)) {
dbg_zonediff("zone_diff: diff_node: There is no counterpart "
"for RRSet of type %u in second tree.\n",
knot_rrset_type(rrset));
rrset->type);
/* RRSet has been removed. Make a copy and remove. */
int ret = knot_zone_diff_changeset_remove_rrset(
param->changeset,
......
......@@ -54,13 +54,13 @@ knot_opt_rr_t *knot_edns_new()
int knot_edns_new_from_rr(knot_opt_rr_t *opt_rr, const knot_rrset_t *rrset)
{
if (opt_rr == NULL || rrset == NULL
|| knot_rrset_type(rrset) != KNOT_RRTYPE_OPT ||
|| rrset->type != KNOT_RRTYPE_OPT ||
knot_rrset_rr_count(rrset) == 0) {
return KNOT_EINVAL;
}
dbg_edns_verb("Parsing payload.\n");
opt_rr->payload = knot_rrset_class(rrset);
opt_rr->payload = rrset->rclass;
/* RFC6891, 6.2.5 Value < 512B should be treated as 512. */
if (opt_rr->payload < EDNS_MIN_UDP_PAYLOAD) {
......
......@@ -766,7 +766,7 @@ int knot_pkt_parse_rr(knot_pkt_t *pkt, unsigned flags)
++pkt->sections[pkt->current].count;
/* Check RR constraints. */
switch(knot_rrset_type(rr)) {
switch(rr->type) {
case KNOT_RRTYPE_TSIG:
// if there is some TSIG already, treat as malformed
if (pkt->tsig_rr != NULL) {
......
......@@ -1797,7 +1797,7 @@ int knot_rrset_txt_dump_data(const knot_rrset_t *rrset,
int ret = 0;
switch (knot_rrset_type(rrset)) {
switch (rrset->type) {
case KNOT_RRTYPE_A:
ret = dump_a(data, data_len, dst, maxlen, style);
break;
......
......@@ -510,26 +510,6 @@ void knot_rrset_rr_set_ttl(const knot_rrset_t *rrset, size_t pos, uint32_t ttl)
}
}
const knot_dname_t *knot_rrset_owner(const knot_rrset_t *rrset)
{
return rrset->owner;
}
knot_dname_t *knot_rrset_get_owner(const knot_rrset_t *rrset)
{
return rrset->owner;
}
uint16_t knot_rrset_type(const knot_rrset_t *rrset)
{
return rrset->type;
}
uint16_t knot_rrset_class(const knot_rrset_t *rrset)
{
return rrset->rclass;
}
uint8_t *knot_rrset_rr_rdata(const knot_rrset_t *rrset, size_t pos)
{
knot_rr_t *rr = knot_rrs_get_rr(&rrset->rrs, pos);
......@@ -827,8 +807,8 @@ bool knot_rrset_is_nsec3rel(const knot_rrset_t *rr)
assert(rr != NULL);
/* Is NSEC3 or non-empty RRSIG covering NSEC3. */
return ((knot_rrset_type(rr) == KNOT_RRTYPE_NSEC3)
|| (knot_rrset_type(rr) == KNOT_RRTYPE_RRSIG
return ((rr->type == KNOT_RRTYPE_NSEC3)
|| (rr->type == KNOT_RRTYPE_RRSIG
&& knot_rrs_rrsig_type_covered(&rr->rrs, 0)
== KNOT_RRTYPE_NSEC3));
}
......@@ -839,7 +819,7 @@ uint64_t rrset_binary_size(const knot_rrset_t *rrset)
return 0;
}
uint64_t size = sizeof(uint64_t) + // size at the beginning
knot_dname_size(knot_rrset_owner(rrset)) + // owner data
knot_dname_size(rrset->owner) + // owner data
sizeof(uint16_t) + // type
sizeof(uint16_t) + // class
sizeof(uint16_t); //RR count
......
......@@ -131,42 +131,6 @@ int knot_rrset_add_rr(knot_rrset_t *rrset, const uint8_t *rdata,
uint8_t* knot_rrset_create_rr(knot_rrset_t *rrset, const uint16_t size,
const uint32_t ttl, mm_ctx_t *mm);
/*!
* \brief Returns the Owner of the RRSet.
*
* \param rrset RRSet to get the Owner of.
*
* \return Owner of the given RRSet.
*/
const knot_dname_t *knot_rrset_owner(const knot_rrset_t *rrset);
/*!
* \brief Returns the Owner of the RRSet.
*
* \param rrset RRSet to get the Owner of.
*
* \return Owner of the given RRSet.
*/
knot_dname_t *knot_rrset_get_owner(const knot_rrset_t *rrset);
/*!
* \brief Returns the TYPE of the RRSet.
*
* \param rrset RRSet to get the TYPE of.
*
* \return TYPE of the given RRSet.
*/
uint16_t knot_rrset_type(const knot_rrset_t *rrset);
/*!
* \brief Returns the CLASS of the RRSet.
*
* \param rrset RRSet to get the CLASS of.
*
* \return CLASS of the given RRSet.
*/
uint16_t knot_rrset_class(const knot_rrset_t *rrset);
/*!
* \brief Returns RDATA of RR on given position.
*
......
......@@ -61,7 +61,7 @@ static int knot_tsig_check_key(const knot_rrset_t *tsig_rr,
return KNOT_EINVAL;
}
const knot_dname_t *tsig_name = knot_rrset_owner(tsig_rr);
const knot_dname_t *tsig_name = tsig_rr->owner;
if (!tsig_name) {
return KNOT_EMALF;
}
......@@ -195,7 +195,7 @@ static int knot_tsig_write_tsig_variables(uint8_t *wire,
}
/* Copy TSIG variables - starting with key name. */
const knot_dname_t *tsig_owner = knot_rrset_owner(tsig_rr);
const knot_dname_t *tsig_owner = tsig_rr->owner;
if (!tsig_owner) {
dbg_tsig("TSIG: write variables: no owner.\n");
return KNOT_EINVAL;
......@@ -208,9 +208,9 @@ static int knot_tsig_write_tsig_variables(uint8_t *wire,
/*!< \todo which order? */
/* Copy class. */
knot_wire_write_u16(wire + offset, knot_rrset_class(tsig_rr));
knot_wire_write_u16(wire + offset, tsig_rr->rclass);
dbg_tsig_verb("TSIG: write variables: written CLASS: %u - \n",
knot_rrset_class(tsig_rr));
tsig_rr->rclass);
dbg_tsig_hex_detail((char *)(wire + offset), sizeof(uint16_t));
offset += sizeof(uint16_t);
......@@ -810,7 +810,7 @@ int knot_tsig_add(uint8_t *msg, size_t *msg_len, size_t msg_max_len,
/*! \todo What key to use, when we do not sign? Does this even work? */
knot_dname_t *key_name =
knot_dname_copy(knot_rrset_owner(tsig_rr), NULL);
knot_dname_copy(tsig_rr->owner, NULL);
if (key_name == NULL) {
dbg_tsig("TSIG: failed to copy owner\n");
return KNOT_ERROR;
......
......@@ -352,7 +352,7 @@ size_t tsig_rdata_tsig_variables_length(const knot_rrset_t *tsig)
return 0;
}
/* Key name, Algorithm name and Other data have variable lengths. */
const knot_dname_t *key_name = knot_rrset_owner(tsig);
const knot_dname_t *key_name = tsig->owner;
if (!key_name) {
return 0;
}
......@@ -444,7 +444,7 @@ size_t tsig_wire_actsize(const knot_rrset_t *tsig)
}
/*! \todo Used fixed size as a base. */
return knot_dname_size(knot_rrset_owner(tsig)) +
return knot_dname_size(tsig->owner) +
sizeof(uint16_t) + /* TYPE */
sizeof(uint16_t) + /* CLASS */
sizeof(uint32_t) + /* TTL */
......
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