summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-07-08 15:12:31 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-07-09 13:46:20 +0200
commit82dfc87c85f00acfa0d46369ae3f66c26a93f502 (patch)
tree566d6dfde5c352b6b366f97afde757f624f2b2f5 /src
parent90c899d46a8f67540fad4ad156f4254fafb4a08d (diff)
datatype: time_type should send milliseconds to userspace
Kernel expects milliseconds, so fix this datatype to use milliseconds instead of seconds. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/datatype.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/datatype.c b/src/datatype.c
index 40e14c93..002c4c66 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -883,7 +883,7 @@ struct error_record *time_parse(const struct location *loc, const char *str,
static void time_type_print(const struct expr *expr)
{
- time_print(mpz_get_uint64(expr->value));
+ time_print(mpz_get_uint64(expr->value) / MSEC_PER_SEC);
}
static struct error_record *time_type_parse(const struct expr *sym,
@@ -896,6 +896,7 @@ static struct error_record *time_type_parse(const struct expr *sym,
if (erec != NULL)
return erec;
+ s *= MSEC_PER_SEC;
if (s > UINT32_MAX)
return error(&sym->location, "value too large");