diff options
Diffstat (limited to 'src/expr/last.c')
-rw-r--r-- | src/expr/last.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/expr/last.c b/src/expr/last.c index 8aa772c..074f463 100644 --- a/src/expr/last.c +++ b/src/expr/last.c @@ -124,10 +124,16 @@ static int nftnl_expr_last_snprintf(char *buf, size_t len, return snprintf(buf, len, "%"PRIu64" ", last->msecs); } +static struct attr_policy last_attr_policy[__NFTNL_EXPR_LAST_MAX] = { + [NFTNL_EXPR_LAST_MSECS] = { .maxlen = sizeof(uint64_t) }, + [NFTNL_EXPR_LAST_SET] = { .maxlen = sizeof(uint32_t) }, +}; + struct expr_ops expr_ops_last = { .name = "last", .alloc_len = sizeof(struct nftnl_expr_last), .nftnl_max_attr = __NFTNL_EXPR_LAST_MAX - 1, + .attr_policy = last_attr_policy, .set = nftnl_expr_last_set, .get = nftnl_expr_last_get, .parse = nftnl_expr_last_parse, |