diff options
author | Frank Wunderlich <frank-w@public-files.de> | 2021-03-21 17:49:16 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-03-25 12:10:30 +0100 |
commit | 8e6cc9f373854ed580156ec6f01bcd97786fa9f7 (patch) | |
tree | 03ed5f94524a9dd610b45fbabc6bd2356e07682f /src/netlink.c | |
parent | f699e4c06a26b4977f4a5d220a0c5260b71d6433 (diff) |
nftables: add flags offload to flowtable
allow flags (currently only offload) in flowtables like it is stated
here: https://lwn.net/Articles/804384/
tested on mt7622/Bananapi-R64
table ip filter {
flowtable f {
hook ingress priority filter + 1
devices = { lan3, lan0, wan }
flags offload;
}
chain forward {
type filter hook forward priority filter; policy accept;
ip protocol { tcp, udp } flow add @f
}
}
table ip nat {
chain post {
type nat hook postrouting priority filter; policy accept;
oifname "wan" masquerade
}
}
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink.c')
-rw-r--r-- | src/netlink.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c index 8c86789b..103fdbd1 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1598,6 +1598,8 @@ netlink_delinearize_flowtable(struct netlink_ctx *ctx, xstrdup(nftnl_flowtable_get_str(nlo, NFTNL_FLOWTABLE_NAME)); flowtable->handle.handle.id = nftnl_flowtable_get_u64(nlo, NFTNL_FLOWTABLE_HANDLE); + if (nftnl_flowtable_is_set(nlo, NFTNL_FLOWTABLE_FLAGS)) + flowtable->flags = nftnl_flowtable_get_u32(nlo, NFTNL_FLOWTABLE_FLAGS); dev_array = nftnl_flowtable_get(nlo, NFTNL_FLOWTABLE_DEVICES); while (dev_array[len]) len++; |