Skip to content
Snippets Groups Projects
Commit dee68d21 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

edns0: declare iterator edns0-capable

parent 9e5b5094
Branches
Tags
No related merge requests found
......@@ -35,3 +35,5 @@
*/
#define KR_DNS_PORT 53
#define KR_DNAME_ROOT ((const knot_dname_t*)"")
#define KR_EDNS_VERSION 0
#define KR_EDNS_PAYLOAD 4096
......@@ -296,6 +296,20 @@ static int prepare_query(knot_layer_t *ctx, knot_pkt_t *pkt)
cur->id = knot_random_uint16_t();
knot_wire_set_id(pkt->wire, cur->id);
/* Declare EDNS0 support. */
knot_rrset_t opt_rr;
ret = knot_edns_init(&opt_rr, KR_EDNS_PAYLOAD, 0, KR_EDNS_VERSION, &pkt->mm);
if (ret != KNOT_EOK) {
return KNOT_NS_PROC_FAIL;
}
knot_pkt_begin(pkt, KNOT_ADDITIONAL);
ret = knot_pkt_put(pkt, KNOT_COMPR_HINT_NONE, &opt_rr, KNOT_PF_FREE);
if (ret != KNOT_EOK) {
knot_rrset_clear(&opt_rr, &pkt->mm);
return KNOT_NS_PROC_FAIL;
}
#ifndef NDEBUG
char name_str[KNOT_DNAME_MAXLEN], zonecut_str[KNOT_DNAME_MAXLEN], ns_str[KNOT_DNAME_MAXLEN], type_str[16];
......
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