- Decrease allocations for "" EDE strings when loading the cachedump.
- Check for existence of EDE code before attaching.
}
/* read remainder of line */
- if(sscanf(s, " %u %u " ARG_LL "d %u %u %u %u %d%n", &flags, &qdcount, &ttl,
+ /* note the last space before any possible EDE text */
+ if(sscanf(s, " %u %u " ARG_LL "d %u %u %u %u %d %n", &flags, &qdcount, &ttl,
&security, &an, &ns, &ar, &ede, &consumed) != 8) {
log_warn("error cannot parse numbers: %s", s);
return 0;
}
/* there may be EDE text after the numbers */
if(consumed > 0 && (size_t)consumed < strlen(s))
- ede_str = s + consumed + 1 /* space */;
+ ede_str = s + consumed;
memset(&rep, 0, sizeof(rep));
rep.flags = (uint16_t)flags;
rep.qdcount = (uint16_t)qdcount;
worker->env.now_tv))
return 0;
/* Attach the cached EDE (RFC8914) */
- if(worker->env.cfg->ede) {
+ if(worker->env.cfg->ede &&
+ msg->rep->reason_bogus != LDNS_EDE_NONE) {
edns_opt_list_append_ede(&edns->opt_list_out,
worker->scratchpad, msg->rep->reason_bogus,
msg->rep->reason_bogus_str);
worker->env.now_tv))
goto bail_out;
/* Attach the cached EDE (RFC8914) */
- if(worker->env.cfg->ede) {
+ if(worker->env.cfg->ede && rep->reason_bogus != LDNS_EDE_NONE) {
edns_opt_list_append_ede(&edns->opt_list_out,
worker->scratchpad, rep->reason_bogus,
rep->reason_bogus_str);
* but a compelling reason to do otherwise is just as valid
* NEW note:
* The compelling reason is that with caching support, the value
- * in the * reply_info is cached.
+ * in the reply_info is cached.
* The reason members of the reply_info struct should be
* updated as they are already cached. No reason to
* try and find the EDE information in errinf anymore.