Commit 7d34aa3e authored by Phil Sutter's avatar Phil Sutter Committed by Pablo Neira Ayuso
Browse files

netfilter: nf_tables: Extend nft_expr_ops::dump callback parameters



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: default avatarPhil Sutter <phil@nwl.cc>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 7394c2dd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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,
+2 −2
Original line number Diff line number Diff line
@@ -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,
+2 −1
Original line number Diff line number Diff line
@@ -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);
+2 −1
Original line number Diff line number Diff line
@@ -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);

Loading