From: pcarana Date: Mon, 1 Apr 2019 23:47:12 +0000 (-0600) Subject: Don't consider AS 0 as a valid ASN X-Git-Tag: v0.0.2~52^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e94ab45ceb8826d4855b9552e5da6d334cc5a13;p=thirdparty%2FFORT-validator.git Don't consider AS 0 as a valid ASN --- diff --git a/src/csv.c b/src/csv.c index 00cf962c..880cacb1 100644 --- 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;