From: Pablo Neira Ayuso Date: Wed, 14 Aug 2024 11:05:54 +0000 (+0200) Subject: datatype: improve error reporting when time unit is not correct X-Git-Tag: v1.0.6.1~190 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47d74ab22d33511ea8efbfe47b870f3057bd2171;p=thirdparty%2Fnftables.git datatype: improve error reporting when time unit is not correct 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 --- diff --git a/src/datatype.c b/src/datatype.c index c2fdf649..cbad56e4 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -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; }