From: Daniel Salzman Date: Wed, 2 Jan 2019 10:18:37 +0000 (+0100) Subject: kdig: unify error states X-Git-Tag: v2.8.0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=259a2d334599ce8f8930be5cfd333113bbbad07d;p=thirdparty%2Fknot-dns.git kdig: unify error states --- diff --git a/src/utils/kdig/kdig_exec.c b/src/utils/kdig/kdig_exec.c index 36b8e237f9..0cdffe265e 100644 --- a/src/utils/kdig/kdig_exec.c +++ b/src/utils/kdig/kdig_exec.c @@ -665,7 +665,7 @@ static int process_query_packet(const knot_pkt_t *query, if (reply == NULL) { ERR("internal error (%s)\n", knot_strerror(KNOT_ENOMEM)); net_close(net); - return 0; + return -1; } // Parse reply to the packet structure. @@ -673,7 +673,7 @@ static int process_query_packet(const knot_pkt_t *query, ERR("malformed reply packet from %s\n", net->remote_str); knot_pkt_free(reply); net_close(net); - return 0; + return -1; } // Compare reply header id. @@ -958,7 +958,7 @@ static int process_xfr_packet(const knot_pkt_t *query, if (reply == NULL) { ERR("internal error (%s)\n", knot_strerror(KNOT_ENOMEM)); net_close(net); - return 0; + return -1; } // Parse reply to the packet structure. @@ -966,7 +966,7 @@ static int process_xfr_packet(const knot_pkt_t *query, ERR("malformed reply packet from %s\n", net->remote_str); knot_pkt_free(reply); net_close(net); - return 0; + return -1; } // Compare reply header id. @@ -974,7 +974,7 @@ static int process_xfr_packet(const knot_pkt_t *query, ERR("reply ID mismatch from %s\n", net->remote_str); knot_pkt_free(reply); net_close(net); - return 0; + return -1; } // Print leading transfer information. @@ -988,7 +988,7 @@ static int process_xfr_packet(const knot_pkt_t *query, knot_pkt_ext_rcode_name(reply)); knot_pkt_free(reply); net_close(net); - return 0; + return -1; } // The first message has a special treatment. @@ -1008,7 +1008,7 @@ static int process_xfr_packet(const knot_pkt_t *query, net->remote_str, knot_strerror(ret)); knot_pkt_free(reply); net_close(net); - return 0; + return -1; } } @@ -1020,7 +1020,7 @@ static int process_xfr_packet(const knot_pkt_t *query, net->remote_str); knot_pkt_free(reply); net_close(net); - return 0; + return -1; } // Check for question sections equality.