From 24f33c710e8ce2fa93573573409d428236c2f6cb Mon Sep 17 00:00:00 2001 From: Laura Garcia Liebana Date: Mon, 17 Jun 2019 18:15:41 +0200 Subject: src: enable set expiration date for set elements Currently, the expiration of every element in a set or map is a read-only parameter generated at kernel side. This change will permit to set a certain expiration date per element that will be required, for example, during stateful replication among several nodes. This patch will enable the _expires_ input parameter in the parser and propagate NFTNL_SET_ELEM_EXPIRATION in order to send the configured value. Signed-off-by: Laura Garcia Liebana Signed-off-by: Pablo Neira Ayuso --- src/netlink.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index 24d8f03a..97eb082c 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -122,6 +122,9 @@ static struct nftnl_set_elem *alloc_nftnl_setelem(const struct expr *set, if (elem->timeout) nftnl_set_elem_set_u64(nlse, NFTNL_SET_ELEM_TIMEOUT, elem->timeout); + if (elem->expiration) + nftnl_set_elem_set_u64(nlse, NFTNL_SET_ELEM_EXPIRATION, + elem->expiration); if (elem->comment || expr->elem_flags) { udbuf = nftnl_udata_buf_alloc(NFT_USERDATA_MAXLEN); if (!udbuf) -- cgit v1.2.3