From: Vsevolod Stakhov Date: Mon, 11 Jun 2018 15:37:26 +0000 (+0100) Subject: [Minor] Add special codes to mark invalid request/reply X-Git-Tag: 1.7.6~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=99dfcd69920f04aea5ac41a411562af3e5f78af5;p=rspamd.git [Minor] Add special codes to mark invalid request/reply --- diff --git a/contrib/librdns/rdns.h b/contrib/librdns/rdns.h index 7ace6e5cd..7ed35514f 100644 --- a/contrib/librdns/rdns.h +++ b/contrib/librdns/rdns.h @@ -45,6 +45,7 @@ struct rdns_io_channel; typedef void (*dns_callback_type) (struct rdns_reply *reply, void *arg); enum rdns_request_type { + RDNS_REQUEST_INVALID = -1, RDNS_REQUEST_A = 1, RDNS_REQUEST_NS = 2, RDNS_REQUEST_SOA = 6, @@ -111,6 +112,7 @@ struct rdns_reply_entry { enum dns_rcode { + RDNS_RC_INVALID = -1, RDNS_RC_NOERROR = 0, RDNS_RC_FORMERR = 1, RDNS_RC_SERVFAIL = 2, diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c index a4018cbd3..401c6aad3 100644 --- a/contrib/librdns/util.c +++ b/contrib/librdns/util.c @@ -286,7 +286,7 @@ rdns_type_fromstr (const char *str) } } - return -1; + return RDNS_REQUEST_INVALID; } enum dns_rcode @@ -334,7 +334,7 @@ rdns_rcode_fromstr (const char *str) } } - return -1; + return RDNS_RC_INVALID; } uint16_t