path: root/src/netlink.c
diff options
authorPablo Neira Ayuso <>2020-03-03 13:14:59 +0100
committerPablo Neira Ayuso <>2020-03-03 14:16:51 +0100
commitd42bd56cff1a22301703d2b9d6d6fc937ea7cfbd (patch)
tree4bba0412324834f49303f0cf237991232daa033c /src/netlink.c
parent8ab720e343af35366f02dc0b9bac102eeedcdbad (diff)
src: support for offload chain flag
This patch extends the basechain definition to allow users to specify the offload flag. This flag enables hardware offload if your drivers supports it. # cat file.nft table netdev x { chain y { type filter hook ingress device eth0 priority 10; flags offload; } } # nft -f file.nft Note: You have to enable offload via ethtool: # ethtool -K eth0 hw-tc-offload on Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/netlink.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 0c6b8c58..671923f3 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -435,6 +435,8 @@ struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx,
xstrdup(nftnl_chain_get_str(nlc, NFTNL_CHAIN_TABLE));
chain-> =
nftnl_chain_get_u64(nlc, NFTNL_CHAIN_HANDLE);
+ if (nftnl_chain_is_set(nlc, NFTNL_CHAIN_FLAGS))
+ chain->flags = nftnl_chain_get_u32(nlc, NFTNL_CHAIN_FLAGS);
if (nftnl_chain_is_set(nlc, NFTNL_CHAIN_HOOKNUM) &&
nftnl_chain_is_set(nlc, NFTNL_CHAIN_PRIO) &&