]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
utils: remove an unused function
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 23 Feb 2018 13:57:50 +0000 (14:57 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 1 Mar 2018 14:07:23 +0000 (15:07 +0100)
Last usage dropped in 1.9, and it seems unlikely to be useful in this
form.

lib/utils.c
lib/utils.h

index 9438fd474a8157ef2fa91d8aaca6fcd1825c0155..5986cd571e1bf26b5a35d812c8942bc3deb89515 100644 (file)
@@ -593,40 +593,6 @@ int kr_rrkey(char *key, const knot_dname_t *owner, uint16_t type, uint8_t rank)
        return (char *)&key_buf[ret] - key;
 }
 
-int kr_rrmap_add(map_t *stash, const knot_rrset_t *rr, uint8_t rank, knot_mm_t *pool)
-{
-       if (!stash || !rr) {
-               return kr_error(EINVAL);
-       }
-
-       /* Stash key = {[1] flags, [1-255] owner, [5] type, [1] \x00 } */
-       char key[KR_RRKEY_LEN];
-       uint8_t extra_flags = 0;
-       uint16_t rrtype = kr_rrset_type_maysig(rr);
-       /* Stash RRSIGs in a special cache, flag them and set type to its covering RR.
-        * This way it the stash won't merge RRSIGs together. */
-       if (rr->type == KNOT_RRTYPE_RRSIG) {
-               extra_flags |= KEY_FLAG_RRSIG;
-       }
-       int ret = kr_rrkey(key, rr->owner, rrtype, rank);
-       if (ret <= 0) {
-               return kr_error(EILSEQ);
-       }
-       key[0] |= extra_flags;
-
-       /* Check if already exists */
-       knot_rrset_t *stashed = map_get(stash, key);
-       if (!stashed) {
-               stashed = knot_rrset_copy(rr, pool);
-               if (!stashed) {
-                       return kr_error(ENOMEM);
-               }
-               return map_set(stash, key, stashed);
-       }
-       /* Merge rdataset */
-       return knot_rdataset_merge(&stashed->rrs, &rr->rrs, pool);
-}
-
 /** Return whether two RRsets match, i.e. would form the same set; see ranked_rr_array_t */
 static inline bool rrsets_match(const knot_rrset_t *rr1, const knot_rrset_t *rr2)
 {
index dba71d6646056f9e29f61ee885acc8ccbe35a3f2..bd646751c5b1f1ed1f171b034d28607f661129fb 100644 (file)
@@ -287,12 +287,6 @@ static inline bool KEY_COVERING_RRSIG(const char *key)
 KR_EXPORT
 int kr_rrkey(char *key, const knot_dname_t *owner, uint16_t type, uint8_t rank);
 
-/** @internal Merges RRSets with matching owner name and type together.
- * @note RRSIG RRSets are merged according the type covered fields.
- * @return 0 or an error
- */
-int kr_rrmap_add(map_t *stash, const knot_rrset_t *rr, uint8_t rank, knot_mm_t *pool);
-
 /** @internal Add RRSet copy to ranked RR array. */
 KR_EXPORT
 int kr_ranked_rrarray_add(ranked_rr_array_t *array, const knot_rrset_t *rr,