History

netfilter: conntrack: handle ->destroy hook via nat_ops instead

The nat module already exposes a few functions to the conntrack core. Move the nat extension destroy hook to it. After this, no conntrack extension needs a destroy hook. 'struct nf_ct_ext_type' and the register/unregister api can be removed in a followup patch.

Florian Westphal committed 4 years ago

Commit 1bc91a51 parent 5f31edc5 files · +16 −36Browse files

Showing the changes to include (2 of 5 files). Show all

Unified · Split

2 files
  1. include/linux/netfilter.h +1 −0
  2. include/net/netfilter/nf_conntrack_extend.h +0 −3
include/linux/netfilter.h+1−0
@@ -379,6 +379,7 @@ struct nf_nat_hook { · 378 unmodified lines
379 unsigned int (*manip_pkt)(struct sk_buff *skb, struct nf_conn *ct,379 unsigned int (*manip_pkt)(struct sk_buff *skb, struct nf_conn *ct,
380 enum nf_nat_manip_type mtype,380 enum nf_nat_manip_type mtype,
381 enum ip_conntrack_dir dir);381 enum ip_conntrack_dir dir);
382 void (*remove_nat_bysrc)(struct nf_conn *ct);
382};383};
383 384
384extern const struct nf_nat_hook __rcu *nf_nat_hook;385extern const struct nf_nat_hook __rcu *nf_nat_hook;
include/net/netfilter/nf_conntrack_extend.h+0−3
@@ -79,9 +79,6 @@ void nf_ct_ext_destroy(struct nf_conn *ct); · 78 unmodified lines
79void *nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);79void *nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp);
80 80
81struct nf_ct_ext_type {81struct nf_ct_ext_type {
82 /* Destroys relationships (can be NULL). */
83 void (*destroy)(struct nf_conn *ct);
84
85 enum nf_ct_ext_id id;82 enum nf_ct_ext_id id;
86};83};
87 84

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t