From 99dfcd69920f04aea5ac41a411562af3e5f78af5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 11 Jun 2018 16:37:26 +0100 Subject: [PATCH] [Minor] Add special codes to mark invalid request/reply --- contrib/librdns/rdns.h | 2 ++ contrib/librdns/util.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 -- 2.39.5