netfilter: conntrack: add nf_ct_iter_data object for nf_ct_iterate_cleanup*()
This patch adds a structure to collect all the context data that is passed to the cleanup iterator. struct nf_ct_iter_data { struct net *net; void *data; u32 portid; int report; }; There is a netns field that allows to clean up conntrack entries specifically owned by the specified netns. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@ -236,10 +236,16 @@ static inline bool nf_ct_kill(struct nf_conn *ct)
|
||||
return nf_ct_delete(ct, 0, 0);
|
||||
}
|
||||
|
||||
struct nf_ct_iter_data {
|
||||
struct net *net;
|
||||
void *data;
|
||||
u32 portid;
|
||||
int report;
|
||||
};
|
||||
|
||||
/* Iterate over all conntracks: if iter returns true, it's deleted. */
|
||||
void nf_ct_iterate_cleanup_net(struct net *net,
|
||||
int (*iter)(struct nf_conn *i, void *data),
|
||||
void *data, u32 portid, int report);
|
||||
void nf_ct_iterate_cleanup_net(int (*iter)(struct nf_conn *i, void *data),
|
||||
const struct nf_ct_iter_data *iter_data);
|
||||
|
||||
/* also set unconfirmed conntracks as dying. Only use in module exit path. */
|
||||
void nf_ct_iterate_destroy(int (*iter)(struct nf_conn *i, void *data),
|
||||
|
Reference in New Issue
Block a user