]> 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>
Thu, 23 Jan 2025 00:35:36 +0000 (01:35 +0100)
commit 6bcaef6a1ea6dc60250ed6124f3b49a8cd29434c upstream.

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 c2fdf6492a14f482c67d9c81cef1edd23415eff0..cbad56e495050ec7d70a3f39af58712924a3a777 100644 (file)
@@ -1305,7 +1305,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;
 }