aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/daemon/worker.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-12-30 13:21:50 +0200
committerRiccardo Spagni <ric@spagni.net>2015-12-30 13:21:50 +0200
commit91001aa4460a59a42dc14a32c8e90717fd29dbd2 (patch)
tree68da43b847d517870a2f5c92a6ef13167730945c /external/unbound/daemon/worker.c
parentMerge pull request #577 (diff)
parentfix missing unbound tests (diff)
downloadmonero-91001aa4460a59a42dc14a32c8e90717fd29dbd2.tar.xz
Merge pull request #578
3edbf57 fix missing unbound tests (Riccardo Spagni) 2d43ae8 update unbound, fix unbound openssl issue on OS X (Riccardo Spagni)
Diffstat (limited to 'external/unbound/daemon/worker.c')
-rw-r--r--external/unbound/daemon/worker.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/external/unbound/daemon/worker.c b/external/unbound/daemon/worker.c
index 79aec4d3a..c90a65998 100644
--- a/external/unbound/daemon/worker.c
+++ b/external/unbound/daemon/worker.c
@@ -866,11 +866,16 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
goto send_reply;
}
if((ret=parse_edns_from_pkt(c->buffer, &edns)) != 0) {
+ struct edns_data reply_edns;
verbose(VERB_ALGO, "worker parse edns: formerror.");
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
- sldns_buffer_rewind(c->buffer);
- LDNS_QR_SET(sldns_buffer_begin(c->buffer));
+ memset(&reply_edns, 0, sizeof(reply_edns));
+ reply_edns.edns_present = 1;
+ reply_edns.udp_size = EDNS_ADVERTISED_SIZE;
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer), ret);
+ error_encode(c->buffer, ret, &qinfo,
+ *(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
+ sldns_buffer_read_u16_at(c->buffer, 2), &reply_edns);
server_stats_insrcode(&worker->stats, c->buffer);
goto send_reply;
}