summaryrefslogtreecommitdiffstats
path: root/lib/zonecut.c
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2018-07-02 14:47:46 +0200
committerVladimír Čunát <vladimir.cunat@nic.cz>2018-08-14 10:36:10 +0200
commit2fa5b27c5cb379cc8024e97e3ee63d1597ccd7c3 (patch)
tree1c8e19bc02cac270f47c6ce0e762bb75cd3fbe1c /lib/zonecut.c
parenttolower-related changes (diff)
downloadknot-resolver-2fa5b27c5cb379cc8024e97e3ee63d1597ccd7c3.tar.xz
knot-resolver-2fa5b27c5cb379cc8024e97e3ee63d1597ccd7c3.zip
knot_rdata_* changes
The _t isn't uint8_t* anymore but a structure with .len and .data.
Diffstat (limited to 'lib/zonecut.c')
-rw-r--r--lib/zonecut.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/zonecut.c b/lib/zonecut.c
index d578132a..8ba28a9a 100644
--- a/lib/zonecut.c
+++ b/lib/zonecut.c
@@ -184,17 +184,15 @@ int kr_zonecut_add(struct kr_zonecut *cut, const knot_dname_t *ns, const knot_rd
return kr_ok();
}
/* Check for duplicates */
- uint16_t rdlen = knot_rdata_rdlen(rdata);
- uint8_t *raw_addr = knot_rdata_data(rdata);
- if (pack_obj_find(*pack, raw_addr, rdlen)) {
+ if (pack_obj_find(*pack, rdata->data, rdata->len)) {
return kr_ok();
}
/* Push new address */
- int ret = pack_reserve_mm(**pack, 1, rdlen, kr_memreserve, cut->pool);
+ int ret = pack_reserve_mm(**pack, 1, rdata->len, kr_memreserve, cut->pool);
if (ret != 0) {
return kr_error(ENOMEM);
}
- return pack_obj_push(*pack, raw_addr, rdlen);
+ return pack_obj_push(*pack, rdata->data, rdata->len);
}
int kr_zonecut_del(struct kr_zonecut *cut, const knot_dname_t *ns, const knot_rdata_t *rdata)
@@ -211,7 +209,7 @@ int kr_zonecut_del(struct kr_zonecut *cut, const knot_dname_t *ns, const knot_rd
}
/* Remove address from the pack. */
if (rdata) {
- ret = pack_obj_del(pack, knot_rdata_data(rdata), knot_rdata_rdlen(rdata));
+ ret = pack_obj_del(pack, rdata->data, rdata->len);
}
/* No servers left, remove NS from the set. */
if (pack->len == 0) {
@@ -306,7 +304,7 @@ static void fetch_addr(struct kr_zonecut *cut, struct kr_cache *cache,
knot_rdata_t *rd = cached_rr.rrs.data;
for (uint16_t i = 0; i < cached_rr.rrs.rr_count; ++i) {
(void) kr_zonecut_add(cut, ns, rd);
- rd = kr_rdataset_next(rd);
+ rd = knot_rdataset_next(rd);
}
}