]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Don't consider AS 0 as a valid ASN
authorpcarana <pc.moreno2099@gmail.com>
Mon, 1 Apr 2019 23:47:12 +0000 (17:47 -0600)
committerpcarana <pc.moreno2099@gmail.com>
Mon, 1 Apr 2019 23:47:12 +0000 (17:47 -0600)
src/csv.c

index 00cf962c01ec3b40526bbaf14b5f12607f04313a..880cacb19ad72a8be75491e2baaade7aaddf5cd4 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
@@ -38,9 +38,8 @@ parse_asn(char *text, unsigned int *value)
                return -EINVAL;
        }
        /* An underflow or overflow will be considered here */
-       if (asn < 0 || UINT32_MAX < asn) {
-               warnx("Prefix length (%lu) is out of range (0-%u).",
-                   asn, UINT32_MAX);
+       if (asn <= 0 || UINT32_MAX < asn) {
+               warnx("ASN (%lu) is out of range [1 - %u].", asn, UINT32_MAX);
                return -EINVAL;
        }
        *value = (unsigned int) asn;