netfilter: nf_tables: Extend nft_expr_ops::dump callback parameters
authorPhil Sutter <phil@nwl.cc>
Fri, 14 Oct 2022 21:45:58 +0000 (23:45 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 15 Nov 2022 09:46:34 +0000 (10:46 +0100)
Add a 'reset' flag just like with nft_object_ops::dump. This will be
useful to reset "anonymous stateful objects", e.g. simple rule counters.

No functional change intended.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
45 files changed:
include/net/netfilter/nf_tables.h
include/net/netfilter/nft_fib.h
include/net/netfilter/nft_meta.h
include/net/netfilter/nft_reject.h
net/ipv4/netfilter/nft_dup_ipv4.c
net/ipv6/netfilter/nft_dup_ipv6.c
net/netfilter/nf_tables_api.c
net/netfilter/nft_bitwise.c
net/netfilter/nft_byteorder.c
net/netfilter/nft_cmp.c
net/netfilter/nft_compat.c
net/netfilter/nft_connlimit.c
net/netfilter/nft_counter.c
net/netfilter/nft_ct.c
net/netfilter/nft_dup_netdev.c
net/netfilter/nft_dynset.c
net/netfilter/nft_exthdr.c
net/netfilter/nft_fib.c
net/netfilter/nft_flow_offload.c
net/netfilter/nft_fwd_netdev.c
net/netfilter/nft_hash.c
net/netfilter/nft_immediate.c
net/netfilter/nft_inner.c
net/netfilter/nft_last.c
net/netfilter/nft_limit.c
net/netfilter/nft_log.c
net/netfilter/nft_lookup.c
net/netfilter/nft_masq.c
net/netfilter/nft_meta.c
net/netfilter/nft_nat.c
net/netfilter/nft_numgen.c
net/netfilter/nft_objref.c
net/netfilter/nft_osf.c
net/netfilter/nft_payload.c
net/netfilter/nft_queue.c
net/netfilter/nft_quota.c
net/netfilter/nft_range.c
net/netfilter/nft_redir.c
net/netfilter/nft_reject.c
net/netfilter/nft_rt.c
net/netfilter/nft_socket.c
net/netfilter/nft_synproxy.c
net/netfilter/nft_tproxy.c
net/netfilter/nft_tunnel.c
net/netfilter/nft_xfrm.c

index 38e2b39..c557a57 100644 (file)
@@ -927,7 +927,8 @@ struct nft_expr_ops {
        void                            (*destroy_clone)(const struct nft_ctx *ctx,
                                                         const struct nft_expr *expr);
        int                             (*dump)(struct sk_buff *skb,
-                                               const struct nft_expr *expr);
+                                               const struct nft_expr *expr,
+                                               bool reset);
        int                             (*validate)(const struct nft_ctx *ctx,
                                                    const struct nft_expr *expr,
                                                    const struct nft_data **data);
index eed099e..167640b 100644 (file)
@@ -18,7 +18,7 @@ nft_fib_is_loopback(const struct sk_buff *skb, const struct net_device *in)
        return skb->pkt_type == PACKET_LOOPBACK || in->flags & IFF_LOOPBACK;
 }
 
-int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr);
+int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr, bool reset);
 int nft_fib_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
                 const struct nlattr * const tb[]);
 int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr,
index f3a5285..ba1238f 100644 (file)
@@ -24,10 +24,10 @@ int nft_meta_set_init(const struct nft_ctx *ctx,
                      const struct nlattr * const tb[]);
 
 int nft_meta_get_dump(struct sk_buff *skb,
-                     const struct nft_expr *expr);
+                     const struct nft_expr *expr, bool reset);
 
 int nft_meta_set_dump(struct sk_buff *skb,
-                     const struct nft_expr *expr);
+                     const struct nft_expr *expr, bool reset);
 
 void nft_meta_get_eval(const struct nft_expr *expr,
                       struct nft_regs *regs,
index 56b123a..6d9ba62 100644 (file)
@@ -22,7 +22,8 @@ int nft_reject_init(const struct nft_ctx *ctx,
                    const struct nft_expr *expr,
                    const struct nlattr * const tb[]);
 
-int nft_reject_dump(struct sk_buff *skb, const struct nft_expr *expr);
+int nft_reject_dump(struct sk_buff *skb,
+                   const struct nft_expr *expr, bool reset);
 
 int nft_reject_icmp_code(u8 code);
 int nft_reject_icmpv6_code(u8 code);
index 0bcd6ae..a522c3a 100644 (file)
@@ -52,7 +52,8 @@ static int nft_dup_ipv4_init(const struct nft_ctx *ctx,
        return err;
 }
 
-static int nft_dup_ipv4_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_dup_ipv4_dump(struct sk_buff *skb,
+                            const struct nft_expr *expr, bool reset)
 {
        struct nft_dup_ipv4 *priv = nft_expr_priv(expr);
 
index 70a405b..c82f3fd 100644 (file)
@@ -50,7 +50,8 @@ static int nft_dup_ipv6_init(const struct nft_ctx *ctx,
        return err;
 }
 
-static int nft_dup_ipv6_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_dup_ipv6_dump(struct sk_buff *skb,
+                            const struct nft_expr *expr, bool reset)
 {
        struct nft_dup_ipv6 *priv = nft_expr_priv(expr);
 
index 62da204..741a0e3 100644 (file)
@@ -2769,7 +2769,7 @@ static int nf_tables_fill_expr_info(struct sk_buff *skb,
                                                            NFTA_EXPR_DATA);
                if (data == NULL)
                        goto nla_put_failure;
-               if (expr->ops->dump(skb, expr) < 0)
+               if (expr->ops->dump(skb, expr, false) < 0)
                        goto nla_put_failure;
                nla_nest_end(skb, data);
        }
index e6e402b..84eae7c 100644 (file)
@@ -232,7 +232,8 @@ static int nft_bitwise_dump_shift(struct sk_buff *skb,
        return 0;
 }
 
-static int nft_bitwise_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_bitwise_dump(struct sk_buff *skb,
+                           const struct nft_expr *expr, bool reset)
 {
        const struct nft_bitwise *priv = nft_expr_priv(expr);
        int err = 0;
@@ -393,7 +394,8 @@ static int nft_bitwise_fast_init(const struct nft_ctx *ctx,
 }
 
 static int
-nft_bitwise_fast_dump(struct sk_buff *skb, const struct nft_expr *expr)
+nft_bitwise_fast_dump(struct sk_buff *skb,
+                     const struct nft_expr *expr, bool reset)
 {
        const struct nft_bitwise_fast_expr *priv = nft_expr_priv(expr);
        struct nft_data data;
index f952a80..b66647a 100644 (file)
@@ -148,7 +148,8 @@ static int nft_byteorder_init(const struct nft_ctx *ctx,
                                        priv->len);
 }
 
-static int nft_byteorder_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_byteorder_dump(struct sk_buff *skb,
+                             const struct nft_expr *expr, bool reset)
 {
        const struct nft_byteorder *priv = nft_expr_priv(expr);
 
index 963cf83..6eb21a4 100644 (file)
@@ -92,7 +92,8 @@ static int nft_cmp_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
        return 0;
 }
 
-static int nft_cmp_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_cmp_dump(struct sk_buff *skb,
+                       const struct nft_expr *expr, bool reset)
 {
        const struct nft_cmp_expr *priv = nft_expr_priv(expr);
 
@@ -253,7 +254,8 @@ static int nft_cmp_fast_offload(struct nft_offload_ctx *ctx,
        return __nft_cmp_offload(ctx, flow, &cmp);
 }
 
-static int nft_cmp_fast_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_cmp_fast_dump(struct sk_buff *skb,
+                            const struct nft_expr *expr, bool reset)
 {
        const struct nft_cmp_fast_expr *priv = nft_expr_priv(expr);
        enum nft_cmp_ops op = priv->inv ? NFT_CMP_NEQ : NFT_CMP_EQ;
@@ -347,7 +349,8 @@ static int nft_cmp16_fast_offload(struct nft_offload_ctx *ctx,
        return __nft_cmp_offload(ctx, flow, &cmp);
 }
 
-static int nft_cmp16_fast_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_cmp16_fast_dump(struct sk_buff *skb,
+                              const struct nft_expr *expr, bool reset)
 {
        const struct nft_cmp16_fast_expr *priv = nft_expr_priv(expr);
        enum nft_cmp_ops op = priv->inv ? NFT_CMP_NEQ : NFT_CMP_EQ;
index c161724..5284cd2 100644 (file)
@@ -324,7 +324,8 @@ static int nft_extension_dump_info(struct sk_buff *skb, int attr,
        return 0;
 }
 
-static int nft_target_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_target_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct xt_target *target = expr->ops->data;
        void *info = nft_expr_priv(expr);
@@ -572,12 +573,14 @@ nla_put_failure:
        return -1;
 }
 
-static int nft_match_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_match_dump(struct sk_buff *skb,
+                         const struct nft_expr *expr, bool reset)
 {
        return __nft_match_dump(skb, expr, nft_expr_priv(expr));
 }
 
-static int nft_match_large_dump(struct sk_buff *skb, const struct nft_expr *e)
+static int nft_match_large_dump(struct sk_buff *skb,
+                               const struct nft_expr *e, bool reset)
 {
        struct nft_xt_match_priv *priv = nft_expr_priv(e);
 
index d657f99..de9d198 100644 (file)
@@ -185,7 +185,8 @@ static void nft_connlimit_eval(const struct nft_expr *expr,
        nft_connlimit_do_eval(priv, regs, pkt, NULL);
 }
 
-static int nft_connlimit_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_connlimit_dump(struct sk_buff *skb,
+                             const struct nft_expr *expr, bool reset)
 {
        struct nft_connlimit *priv = nft_expr_priv(expr);
 
index f4d3573..06482fb 100644 (file)
@@ -201,7 +201,8 @@ void nft_counter_eval(const struct nft_expr *expr, struct nft_regs *regs,
        nft_counter_do_eval(priv, regs, pkt);
 }
 
-static int nft_counter_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_counter_dump(struct sk_buff *skb,
+                           const struct nft_expr *expr, bool reset)
 {
        struct nft_counter_percpu_priv *priv = nft_expr_priv(expr);
 
index a3f01f2..a0696d7 100644 (file)
@@ -641,7 +641,8 @@ static void nft_ct_set_destroy(const struct nft_ctx *ctx,
        nf_ct_netns_put(ctx->net, ctx->family);
 }
 
-static int nft_ct_get_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_ct_get_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_ct *priv = nft_expr_priv(expr);
 
@@ -703,7 +704,8 @@ static bool nft_ct_get_reduce(struct nft_regs_track *track,
        return nft_expr_reduce_bitwise(track, expr);
 }
 
-static int nft_ct_set_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_ct_set_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_ct *priv = nft_expr_priv(expr);
 
index 6350740..e5739a5 100644 (file)
@@ -44,7 +44,8 @@ static int nft_dup_netdev_init(const struct nft_ctx *ctx,
                                       sizeof(int));
 }
 
-static int nft_dup_netdev_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_dup_netdev_dump(struct sk_buff *skb,
+                              const struct nft_expr *expr, bool reset)
 {
        struct nft_dup_netdev *priv = nft_expr_priv(expr);
 
index 6983e6d..01c61e0 100644 (file)
@@ -357,7 +357,8 @@ static void nft_dynset_destroy(const struct nft_ctx *ctx,
        nf_tables_destroy_set(ctx, priv->set);
 }
 
-static int nft_dynset_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_dynset_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_dynset *priv = nft_expr_priv(expr);
        u32 flags = priv->invert ? NFT_DYNSET_F_INV : 0;
index a67ea9c..ed929d0 100644 (file)
@@ -576,7 +576,8 @@ nla_put_failure:
        return -1;
 }
 
-static int nft_exthdr_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_exthdr_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_exthdr *priv = nft_expr_priv(expr);
 
@@ -586,7 +587,8 @@ static int nft_exthdr_dump(struct sk_buff *skb, const struct nft_expr *expr)
        return nft_exthdr_dump_common(skb, priv);
 }
 
-static int nft_exthdr_dump_set(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_exthdr_dump_set(struct sk_buff *skb,
+                              const struct nft_expr *expr, bool reset)
 {
        const struct nft_exthdr *priv = nft_expr_priv(expr);
 
@@ -596,7 +598,8 @@ static int nft_exthdr_dump_set(struct sk_buff *skb, const struct nft_expr *expr)
        return nft_exthdr_dump_common(skb, priv);
 }
 
-static int nft_exthdr_dump_strip(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_exthdr_dump_strip(struct sk_buff *skb,
+                                const struct nft_expr *expr, bool reset)
 {
        const struct nft_exthdr *priv = nft_expr_priv(expr);
 
index 1f12d7a..6e049fd 100644 (file)
@@ -118,7 +118,7 @@ int nft_fib_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
 }
 EXPORT_SYMBOL_GPL(nft_fib_init);
 
-int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr)
+int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr, bool reset)
 {
        const struct nft_fib *priv = nft_expr_priv(expr);
 
index a25c88b..e860d8f 100644 (file)
@@ -433,7 +433,8 @@ static void nft_flow_offload_destroy(const struct nft_ctx *ctx,
        nf_ct_netns_put(ctx->net, ctx->family);
 }
 
-static int nft_flow_offload_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_flow_offload_dump(struct sk_buff *skb,
+                                const struct nft_expr *expr, bool reset)
 {
        struct nft_flow_offload *priv = nft_expr_priv(expr);
 
index 7c5876d..7b9d4d1 100644 (file)
@@ -56,7 +56,8 @@ static int nft_fwd_netdev_init(const struct nft_ctx *ctx,
                                       sizeof(int));
 }
 
-static int nft_fwd_netdev_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_fwd_netdev_dump(struct sk_buff *skb,
+                              const struct nft_expr *expr, bool reset)
 {
        struct nft_fwd_netdev *priv = nft_expr_priv(expr);
 
@@ -186,7 +187,8 @@ static int nft_fwd_neigh_init(const struct nft_ctx *ctx,
                                       addr_len);
 }
 
-static int nft_fwd_neigh_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_fwd_neigh_dump(struct sk_buff *skb,
+                             const struct nft_expr *expr, bool reset)
 {
        struct nft_fwd_neigh *priv = nft_expr_priv(expr);
 
index e5631e8..ee8d487 100644 (file)
@@ -139,7 +139,7 @@ static int nft_symhash_init(const struct nft_ctx *ctx,
 }
 
 static int nft_jhash_dump(struct sk_buff *skb,
-                         const struct nft_expr *expr)
+                         const struct nft_expr *expr, bool reset)
 {
        const struct nft_jhash *priv = nft_expr_priv(expr);
 
@@ -176,7 +176,7 @@ static bool nft_jhash_reduce(struct nft_regs_track *track,
 }
 
 static int nft_symhash_dump(struct sk_buff *skb,
-                           const struct nft_expr *expr)
+                           const struct nft_expr *expr, bool reset)
 {
        const struct nft_symhash *priv = nft_expr_priv(expr);
 
index 5f28b21..c9d2f7c 100644 (file)
@@ -147,7 +147,8 @@ static void nft_immediate_destroy(const struct nft_ctx *ctx,
        }
 }
 
-static int nft_immediate_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_immediate_dump(struct sk_buff *skb,
+                             const struct nft_expr *expr, bool reset)
 {
        const struct nft_immediate_expr *priv = nft_expr_priv(expr);
 
index 809f0d0..6d96b82 100644 (file)
@@ -347,7 +347,8 @@ static int nft_inner_init(const struct nft_ctx *ctx,
        return 0;
 }
 
-static int nft_inner_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_inner_dump(struct sk_buff *skb,
+                         const struct nft_expr *expr, bool reset)
 {
        const struct nft_inner *priv = nft_expr_priv(expr);
 
index bb15a55..7f2bda6 100644 (file)
@@ -65,7 +65,8 @@ static void nft_last_eval(const struct nft_expr *expr,
                WRITE_ONCE(last->set, 1);
 }
 
-static int nft_last_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_last_dump(struct sk_buff *skb,
+                        const struct nft_expr *expr, bool reset)
 {
        struct nft_last_priv *priv = nft_expr_priv(expr);
        struct nft_last *last = priv->last;
index 981addb..145dc62 100644 (file)
@@ -193,7 +193,8 @@ static int nft_limit_pkts_init(const struct nft_ctx *ctx,
        return 0;
 }
 
-static int nft_limit_pkts_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_limit_pkts_dump(struct sk_buff *skb,
+                              const struct nft_expr *expr, bool reset)
 {
        const struct nft_limit_priv_pkts *priv = nft_expr_priv(expr);
 
@@ -251,7 +252,7 @@ static int nft_limit_bytes_init(const struct nft_ctx *ctx,
 }
 
 static int nft_limit_bytes_dump(struct sk_buff *skb,
-                               const struct nft_expr *expr)
+                               const struct nft_expr *expr, bool reset)
 {
        const struct nft_limit_priv *priv = nft_expr_priv(expr);
 
index 0e13c00..5defe6e 100644 (file)
@@ -241,7 +241,8 @@ static void nft_log_destroy(const struct nft_ctx *ctx,
        nf_logger_put(ctx->family, li->type);
 }
 
-static int nft_log_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_log_dump(struct sk_buff *skb,
+                       const struct nft_expr *expr, bool reset)
 {
        const struct nft_log *priv = nft_expr_priv(expr);
        const struct nf_loginfo *li = &priv->loginfo;
index dfae127..cae5a67 100644 (file)
@@ -178,7 +178,8 @@ static void nft_lookup_destroy(const struct nft_ctx *ctx,
        nf_tables_destroy_set(ctx, priv->set);
 }
 
-static int nft_lookup_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_lookup_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_lookup *priv = nft_expr_priv(expr);
        u32 flags = priv->invert ? NFT_LOOKUP_F_INV : 0;
index 2a0adc4..e55e455 100644 (file)
@@ -73,7 +73,8 @@ static int nft_masq_init(const struct nft_ctx *ctx,
        return nf_ct_netns_get(ctx->net, ctx->family);
 }
 
-static int nft_masq_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_masq_dump(struct sk_buff *skb,
+                        const struct nft_expr *expr, bool reset)
 {
        const struct nft_masq *priv = nft_expr_priv(expr);
 
index 8c39ade..e384e0d 100644 (file)
@@ -669,7 +669,7 @@ int nft_meta_set_init(const struct nft_ctx *ctx,
 EXPORT_SYMBOL_GPL(nft_meta_set_init);
 
 int nft_meta_get_dump(struct sk_buff *skb,
-                     const struct nft_expr *expr)
+                     const struct nft_expr *expr, bool reset)
 {
        const struct nft_meta *priv = nft_expr_priv(expr);
 
@@ -684,7 +684,8 @@ nla_put_failure:
 }
 EXPORT_SYMBOL_GPL(nft_meta_get_dump);
 
-int nft_meta_set_dump(struct sk_buff *skb, const struct nft_expr *expr)
+int nft_meta_set_dump(struct sk_buff *skb,
+                     const struct nft_expr *expr, bool reset)
 {
        const struct nft_meta *priv = nft_expr_priv(expr);
 
index e5fd699..0479991 100644 (file)
@@ -255,7 +255,8 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
        return nf_ct_netns_get(ctx->net, family);
 }
 
-static int nft_nat_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_nat_dump(struct sk_buff *skb,
+                       const struct nft_expr *expr, bool reset)
 {
        const struct nft_nat *priv = nft_expr_priv(expr);
 
index 45d3dc9..7d29db7 100644 (file)
@@ -112,7 +112,8 @@ nla_put_failure:
        return -1;
 }
 
-static int nft_ng_inc_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_ng_inc_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_ng_inc *priv = nft_expr_priv(expr);
 
@@ -168,7 +169,8 @@ static int nft_ng_random_init(const struct nft_ctx *ctx,
                                        NULL, NFT_DATA_VALUE, sizeof(u32));
 }
 
-static int nft_ng_random_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_ng_random_dump(struct sk_buff *skb,
+                             const struct nft_expr *expr, bool reset)
 {
        const struct nft_ng_random *priv = nft_expr_priv(expr);
 
index 74e0eea..7b01aa2 100644 (file)
@@ -47,7 +47,8 @@ static int nft_objref_init(const struct nft_ctx *ctx,
        return 0;
 }
 
-static int nft_objref_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_objref_dump(struct sk_buff *skb,
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_object *obj = nft_objref_priv(expr);
 
@@ -155,7 +156,8 @@ static int nft_objref_map_init(const struct nft_ctx *ctx,
        return 0;
 }
 
-static int nft_objref_map_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_objref_map_dump(struct sk_buff *skb,
+                              const struct nft_expr *expr, bool reset)
 {
        const struct nft_objref_map *priv = nft_expr_priv(expr);
 
index adacf95..70820c6 100644 (file)
@@ -92,7 +92,8 @@ static int nft_osf_init(const struct nft_ctx *ctx,
        return 0;
 }
 
-static int nft_osf_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_osf_dump(struct sk_buff *skb,
+                       const struct nft_expr *expr, bool reset)
 {
        const struct nft_osf *priv = nft_expr_priv(expr);
 
index 53e64d8..336ac66 100644 (file)
@@ -231,7 +231,8 @@ static int nft_payload_init(const struct nft_ctx *ctx,
                                        priv->len);
 }
 
-static int nft_payload_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_payload_dump(struct sk_buff *skb,
+                           const struct nft_expr *expr, bool reset)
 {
        const struct nft_payload *priv = nft_expr_priv(expr);
 
@@ -919,7 +920,8 @@ static int nft_payload_set_init(const struct nft_ctx *ctx,
                                       priv->len);
 }
 
-static int nft_payload_set_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_payload_set_dump(struct sk_buff *skb,
+                               const struct nft_expr *expr, bool reset)
 {
        const struct nft_payload_set *priv = nft_expr_priv(expr);
 
index da29e92..b2b8127 100644 (file)
@@ -152,7 +152,8 @@ static int nft_queue_sreg_init(const struct nft_ctx *ctx,
        return 0;
 }
 
-static int nft_queue_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_queue_dump(struct sk_buff *skb,
+                         const struct nft_expr *expr, bool reset)
 {
        const struct nft_queue *priv = nft_expr_priv(expr);
 
@@ -168,7 +169,8 @@ nla_put_failure:
 }
 
 static int
-nft_queue_sreg_dump(struct sk_buff *skb, const struct nft_expr *expr)
+nft_queue_sreg_dump(struct sk_buff *skb,
+                   const struct nft_expr *expr, bool reset)
 {
        const struct nft_queue *priv = nft_expr_priv(expr);
 
index e6b0df6..b1a1217 100644 (file)
@@ -217,7 +217,8 @@ static int nft_quota_init(const struct nft_ctx *ctx,
        return nft_quota_do_init(tb, priv);
 }
 
-static int nft_quota_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_quota_dump(struct sk_buff *skb,
+                         const struct nft_expr *expr, bool reset)
 {
        struct nft_quota *priv = nft_expr_priv(expr);
 
index 832f0d7..0566d6a 100644 (file)
@@ -111,7 +111,8 @@ err1:
        return err;
 }
 
-static int nft_range_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_range_dump(struct sk_buff *skb,
+                         const struct nft_expr *expr, bool reset)
 {
        const struct nft_range_expr *priv = nft_expr_priv(expr);
 
index 5086adf..5f77399 100644 (file)
@@ -75,7 +75,8 @@ static int nft_redir_init(const struct nft_ctx *ctx,
        return nf_ct_netns_get(ctx->net, ctx->family);
 }
 
-static int nft_redir_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_redir_dump(struct sk_buff *skb,
+                         const struct nft_expr *expr, bool reset)
 {
        const struct nft_redir *priv = nft_expr_priv(expr);
 
index 927ff84..f2addc8 100644 (file)
@@ -69,7 +69,8 @@ int nft_reject_init(const struct nft_ctx *ctx,
 }
 EXPORT_SYMBOL_GPL(nft_reject_init);
 
-int nft_reject_dump(struct sk_buff *skb, const struct nft_expr *expr)
+int nft_reject_dump(struct sk_buff *skb,
+                   const struct nft_expr *expr, bool reset)
 {
        const struct nft_reject *priv = nft_expr_priv(expr);
 
index 71931ec..5990fdd 100644 (file)
@@ -146,7 +146,7 @@ static int nft_rt_get_init(const struct nft_ctx *ctx,
 }
 
 static int nft_rt_get_dump(struct sk_buff *skb,
-                          const struct nft_expr *expr)
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_rt *priv = nft_expr_priv(expr);
 
index 49a5348..85f8df8 100644 (file)
@@ -199,7 +199,7 @@ static int nft_socket_init(const struct nft_ctx *ctx,
 }
 
 static int nft_socket_dump(struct sk_buff *skb,
-                          const struct nft_expr *expr)
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_socket *priv = nft_expr_priv(expr);
 
index 6cf9a04..13da882 100644 (file)
@@ -272,7 +272,8 @@ static void nft_synproxy_destroy(const struct nft_ctx *ctx,
        nft_synproxy_do_destroy(ctx);
 }
 
-static int nft_synproxy_dump(struct sk_buff *skb, const struct nft_expr *expr)
+static int nft_synproxy_dump(struct sk_buff *skb,
+                            const struct nft_expr *expr, bool reset)
 {
        struct nft_synproxy *priv = nft_expr_priv(expr);
 
index 62da25a..ea83f66 100644 (file)
@@ -294,7 +294,7 @@ static void nft_tproxy_destroy(const struct nft_ctx *ctx,
 }
 
 static int nft_tproxy_dump(struct sk_buff *skb,
-                          const struct nft_expr *expr)
+                          const struct nft_expr *expr, bool reset)
 {
        const struct nft_tproxy *priv = nft_expr_priv(expr);
 
index 983ade4..b059aa5 100644 (file)
@@ -108,7 +108,7 @@ static int nft_tunnel_get_init(const struct nft_ctx *ctx,
 }
 
 static int nft_tunnel_get_dump(struct sk_buff *skb,
-                              const struct nft_expr *expr)
+                              const struct nft_expr *expr, bool reset)
 {
        const struct nft_tunnel *priv = nft_expr_priv(expr);
 
index 1c5343c..c88fd07 100644 (file)
@@ -212,7 +212,7 @@ static void nft_xfrm_get_eval(const struct nft_expr *expr,
 }
 
 static int nft_xfrm_get_dump(struct sk_buff *skb,
-                            const struct nft_expr *expr)
+                            const struct nft_expr *expr, bool reset)
 {
        const struct nft_xfrm *priv = nft_expr_priv(expr);