]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: improve error reporting when time unit is not correct
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 14 Aug 2024 11:05:54 +0000 (13:05 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 19 Aug 2024 15:24:31 +0000 (17:24 +0200)
Display:

  Wrong unit format, expecting bytes or kbytes or mbytes

instead of:

  Wrong rate format

Fixes: 6615676d825e ("src: add per-bytes limit")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/datatype.c

index 297c5d0409d521405987162965b415ff961fc7c5..6bbe900295f7276cec5efb1950df1648fc25d45c 100644 (file)
@@ -1477,7 +1477,7 @@ static struct error_record *time_unit_parse(const struct location *loc,
        else if (strcmp(str, "week") == 0)
                *unit = 1ULL * 60 * 60 * 24 * 7;
        else
-               return error(loc, "Wrong rate format");
+               return error(loc, "Wrong time format, expecting second, minute, hour, day or week");
 
        return NULL;
 }