summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-02-26 18:49:03 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-02-26 18:49:03 +0000
commit48f4125dafde00acf92686b6e824d0aa0323bb54 (patch)
treed95834abec05171b6e915d928373f7fd86d5f017
parentaff4fad1b58a00f6fbb3b3fa2fc25080b018e23c (diff)
no need to go through RETERR when we return a constant
-rw-r--r--usr.bin/dig/lib/dns/rdata.c14
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/caa_257.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/hip_55.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c6
5 files changed, 22 insertions, 22 deletions
diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c
index bb1509d7d8f..32a7150175b 100644
--- a/usr.bin/dig/lib/dns/rdata.c
+++ b/usr.bin/dig/lib/dns/rdata.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.29 2020/02/26 18:47:58 florian Exp $ */
+/* $Id: rdata.c,v 1.30 2020/02/26 18:49:02 florian Exp $ */
/*! \file */
@@ -225,7 +225,7 @@ typemap_test(isc_region_t *sr, isc_boolean_t allow_empty) {
* Check for overflow.
*/
if (i + 2 > sr->length)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
window = sr->base[i];
len = sr->base[i + 1];
i += 2;
@@ -233,29 +233,29 @@ typemap_test(isc_region_t *sr, isc_boolean_t allow_empty) {
* Check that bitmap windows are in the correct order.
*/
if (!first && window <= lastwindow)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
/*
* Check for legal lengths.
*/
if (len < 1 || len > 32)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
/*
* Check for overflow.
*/
if (i + len > sr->length)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
/*
* The last octet of the bitmap must be non zero.
*/
if (sr->base[i + len - 1] == 0)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
lastwindow = window;
first = ISC_FALSE;
}
if (i != sr->length)
return (DNS_R_EXTRADATA);
if (!allow_empty && first)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/caa_257.c b/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
index 946be520397..45a7714d028 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
@@ -101,12 +101,12 @@ fromwire_caa(ARGS_FROMWIRE) {
* Zero length tag fields are illegal.
*/
if (sr.length < len || len == 0)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
/* Check the Tag's value */
for (i = 0; i < len; i++)
if (!alphanumeric[sr.base[i]])
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
/*
* Tag + Value
*/
diff --git a/usr.bin/dig/lib/dns/rdata/generic/hip_55.c b/usr.bin/dig/lib/dns/rdata/generic/hip_55.c
index 9cc6a95fc85..f09b1b6133a 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/hip_55.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/hip_55.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hip_55.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */
+/* $Id: hip_55.c,v 1.14 2020/02/26 18:49:02 florian Exp $ */
/* reviewed: TBC */
@@ -105,19 +105,19 @@ fromwire_hip(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &region);
if (region.length < 4U)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
rr = region;
hit_len = uint8_fromregion(&region);
if (hit_len == 0)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
isc_region_consume(&region, 2); /* hit length + algorithm */
key_len = uint16_fromregion(&region);
if (key_len == 0)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
isc_region_consume(&region, 2);
if (region.length < (unsigned) (hit_len + key_len))
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
RETERR(isc_mem_tobuffer(target, rr.base, 4 + hit_len + key_len));
isc_buffer_forward(source, 4 + hit_len + key_len);
diff --git a/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c b/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c
index 7a041c92502..5d898975c95 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3_50.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */
+/* $Id: nsec3_50.c,v 1.12 2020/02/26 18:49:02 florian Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -129,21 +129,21 @@ fromwire_nsec3(ARGS_FROMWIRE) {
/* hash(1), flags(1), iteration(2), saltlen(1) */
if (sr.length < 5U)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
saltlen = sr.base[4];
isc_region_consume(&sr, 5);
if (sr.length < saltlen)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
isc_region_consume(&sr, saltlen);
if (sr.length < 1U)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
hashlen = sr.base[0];
isc_region_consume(&sr, 1);
if (sr.length < hashlen)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
isc_region_consume(&sr, hashlen);
RETERR(typemap_test(&sr, ISC_TRUE));
diff --git a/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c b/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c
index faced7660ce..422d845be55 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3param_51.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
+/* $Id: nsec3param_51.c,v 1.13 2020/02/26 18:49:02 florian Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -105,12 +105,12 @@ fromwire_nsec3param(ARGS_FROMWIRE) {
/* hash(1), flags(1), iterations(2), saltlen(1) */
if (sr.length < 5U)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
saltlen = sr.base[4];
isc_region_consume(&sr, 5);
if (sr.length < saltlen)
- RETERR(DNS_R_FORMERR);
+ return (DNS_R_FORMERR);
isc_region_consume(&sr, saltlen);
RETERR(isc_mem_tobuffer(target, rr.base, rr.length));
isc_buffer_forward(source, rr.length);