edns-subnet retain rcode when no return_msg, for log-servfail.
@@ -464,7 +464,12 @@ eval_response(struct module_qstate *qstate, int id, struct subnet_qstate *sq)
memset(c_out, 0, sizeof(*c_out));
- if (!qstate->return_msg) return module_error;
+ if (!qstate->return_msg) {
+ /* already an answer and its not a message, but retain
+ * the actual rcode, instead of module_error, so send
+ * module_finished */
+ return module_finished;
+ }
/* We have not asked for subnet data */
if (!sq->subnet_sent) {
@@ -743,7 +748,8 @@ subnetmod_operate(struct module_qstate *qstate, enum module_ev event,
/* Query handed back by next module, we have a 'final' answer */
if(sq && event == module_event_moddone) {
qstate->ext_state[id] = eval_response(qstate, id, sq);
- if(qstate->ext_state[id] == module_finished) {
+ if(qstate->ext_state[id] == module_finished &&
+ qstate->return_msg) {
ecs_opt_list_append(&sq->ecs_client_out,
&qstate->edns_opts_front_out, qstate);
}
