kr_request: remove ::additional

Somehow I didn't notice this field when adding ::add_selected.
We probably never put anything into answer's ADDITIONAL,
so noone's noticed a problem until now.
parent aaef1eca
......@@ -6,6 +6,12 @@ Bugfixes
- tls_client: fix issue with TLS session resumption (#489)
Module API changes
------------------
- kr_request::add_selected is now really put into answer,
instead of the "duplicate" ::additional field (#490)
Knot Resolver 4.1.0 (2019-07-10)
================================
......
......@@ -126,11 +126,6 @@ struct kr_qflags {
_Bool NO_NS_FOUND : 1;
_Bool PKT_IS_SANE : 1;
};
typedef struct {
knot_rrset_t **at;
size_t len;
size_t cap;
} rr_array_t;
struct ranked_rr_array_entry {
uint32_t qry_uid;
uint8_t rank;
......@@ -192,7 +187,6 @@ struct kr_request {
ranked_rr_array_t answ_selected;
ranked_rr_array_t auth_selected;
ranked_rr_array_t add_selected;
rr_array_t additional;
_Bool answ_validated;
_Bool auth_validated;
uint8_t rank;
......
......@@ -103,7 +103,6 @@ ${CDEFS} ${LIBKRES} types <<-EOF
trie_t
# libkres
struct kr_qflags
rr_array_t
struct ranked_rr_array_entry
ranked_rr_array_entry_t
ranked_rr_array_t
......
......@@ -461,18 +461,6 @@ static int answer_prepare(struct kr_request *req, knot_pkt_t *query)
return kr_ok();
}
/** @return error code, ignoring if forced to truncate the packet. */
static int write_extra_records(const rr_array_t *arr, uint16_t reorder, knot_pkt_t *answer)
{
for (size_t i = 0; i < arr->len; ++i) {
int err = knot_pkt_put_rotate(answer, 0, arr->at[i], reorder, KNOT_PF_NOTRUNC);
if (err != KNOT_EOK) {
return err == KNOT_ESPACE ? kr_ok() : kr_error(err);
}
}
return kr_ok();
}
/**
* @param all_secure optionally &&-combine security of written RRs into its value.
* (i.e. if you pass a pointer to false, it will always remain)
......@@ -658,7 +646,8 @@ static void answer_finalize(struct kr_request *request)
|| write_extra_ranked_records(&request->auth_selected, reorder,
answer, &secure, NULL)
|| knot_pkt_begin(answer, KNOT_ADDITIONAL)
|| write_extra_records(&request->additional, reorder, answer)
|| write_extra_ranked_records(&request->add_selected, reorder,
answer, NULL/*not relevant to AD*/, NULL)
|| answer_append_edns(request)
)
{
......@@ -737,7 +726,6 @@ int kr_resolve_begin(struct kr_request *request, struct kr_context *ctx, knot_pk
request->options = ctx->options;
request->state = KR_STATE_CONSUME;
request->current_query = NULL;
array_init(request->additional);
array_init(request->answ_selected);
array_init(request->auth_selected);
array_init(request->add_selected);
......
......@@ -214,7 +214,6 @@ struct kr_request {
ranked_rr_array_t answ_selected;
ranked_rr_array_t auth_selected;
ranked_rr_array_t add_selected;
rr_array_t additional;
bool answ_validated; /**< internal to validator; beware of caching, etc. */
bool auth_validated; /**< see answ_validated ^^ ; TODO */
......
......@@ -187,7 +187,6 @@ static inline long time_diff(struct timeval *begin, struct timeval *end) {
/** @cond internal Array types */
struct kr_context;
typedef array_t(knot_rrset_t *) rr_array_t;
struct ranked_rr_array_entry {
uint32_t qry_uid;
uint8_t rank; /**< enum kr_rank */
......
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