diff options
author | Patrick McHardy <kaber@trash.net> | 2016-04-27 12:29:50 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-05-13 19:30:29 +0200 |
commit | 3ed5e31f4a323d7f054b6120d05134195dc681f0 (patch) | |
tree | 5daa5afd681e9b3dbada6405659cd11cefc19554 /src/netlink.c | |
parent | 9f3cce668b72c9ec9d9e0a6071d132a8f35d7b70 (diff) |
src: add flow statement
The flow statement allows to instantiate per flow statements for user
defined flows. This can so far be used for per flow accounting or limiting,
similar to what the iptables hashlimit provides. Flows can be aged using
the timeout option.
Examples:
# nft filter input flow ip saddr . tcp dport limit rate 10/second
# nft filter input flow table acct iif . ip saddr timeout 60s counter
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink.c')
-rw-r--r-- | src/netlink.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c index d727cd2d..b0dcb907 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1460,6 +1460,12 @@ static int netlink_delinearize_setelem(struct nftnl_set_elem *nlse, expr->comment = xmalloc(len); memcpy((char *)expr->comment, data, len); } + if (nftnl_set_elem_is_set(nlse, NFT_SET_ELEM_ATTR_EXPR)) { + const struct nftnl_expr *nle; + + nle = nftnl_set_elem_get(nlse, NFT_SET_ELEM_ATTR_EXPR, NULL); + expr->stmt = netlink_parse_set_expr(set, nle); + } if (flags & NFT_SET_ELEM_INTERVAL_END) { expr->flags |= EXPR_F_INTERVAL_END; |