summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-27 19:38:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-27 19:38:42 +0100
commit42138e70dfde9b74df304332a7473788a4089da1 (patch)
treebc58fa86c4754918f663dbeeace9eb6caccf2be0
parenta147221e052f5076fc45544d77f8347361b67542 (diff)
downloadrspamd-42138e70dfde9b74df304332a7473788a4089da1.tar.gz
rspamd-42138e70dfde9b74df304332a7473788a4089da1.zip
[Fix] Do not distinguish NXDOMAIN and NOREC for monitored
-rw-r--r--src/libserver/monitored.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libserver/monitored.c b/src/libserver/monitored.c
index d41ce652e..b69261234 100644
--- a/src/libserver/monitored.c
+++ b/src/libserver/monitored.c
@@ -249,10 +249,19 @@ rspamd_monitored_dns_cb (struct rdns_reply *reply, void *arg)
else {
if (conf->expected_code != -1) {
if (reply->code != conf->expected_code) {
- msg_info_mon ("DNS reply returned %s while %s is expected",
- rdns_strerror (reply->code),
- rdns_strerror (conf->expected_code));
- rspamd_monitored_propagate_error (m, "invalid return");
+ if (reply->code == RDNS_RC_NOREC &&
+ conf->expected_code == RDNS_RC_NXDOMAIN) {
+ rspamd_monitored_propagate_success (m, lat);
+ }
+ else {
+ msg_info_mon ("DNS reply returned %s while %s is expected",
+ rdns_strerror (reply->code),
+ rdns_strerror (conf->expected_code));
+ rspamd_monitored_propagate_error (m, "invalid return");
+ }
+ }
+ else {
+ rspamd_monitored_propagate_success (m, lat);
}
}
else if (conf->expected) {