Remove circular dependency between nf_nat module and nf_conntrack one moving bpf_ct_set_nat_info kfunc in nf_nat_bpf.c
Showing the changes to include/net (1 of 5 files). Show all
Unified · Split
| @@ -4,6 +4,11 @@ · 3 unmodified lines | |||
| 4 | #define _NF_CONNTRACK_BPF_H | 4 | #define _NF_CONNTRACK_BPF_H |
| 5 | 5 | ||
| 6 | #include <linux/kconfig.h> | 6 | #include <linux/kconfig.h> |
| 7 | #include <net/netfilter/nf_conntrack.h> | ||
| 8 | |||
| 9 | struct nf_conn___init { | ||
| 10 | struct nf_conn ct; | ||
| 11 | }; | ||
| 7 | 12 | ||
| 8 | #if (IS_BUILTIN(CONFIG_NF_CONNTRACK) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) || \ | 13 | #if (IS_BUILTIN(CONFIG_NF_CONNTRACK) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) || \ |
| 9 | (IS_MODULE(CONFIG_NF_CONNTRACK) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES)) | 14 | (IS_MODULE(CONFIG_NF_CONNTRACK) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES)) |
| @@ -24,4 +29,18 @@ static inline void cleanup_nf_conntrack_bpf(void) · 14 unmodified lines | |||
| 24 | 29 | ||
| 25 | #endif | 30 | #endif |
| 26 | 31 | ||
| 32 | #if (IS_BUILTIN(CONFIG_NF_NAT) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) || \ | ||
| 33 | (IS_MODULE(CONFIG_NF_NAT) && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES)) | ||
| 34 | |||
| 35 | extern int register_nf_nat_bpf(void); | ||
| 36 | |||
| 37 | #else | ||
| 38 | |||
| 39 | static inline int register_nf_nat_bpf(void) | ||
| 40 | { | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | |||
| 44 | #endif | ||
| 45 | |||
| 27 | #endif /* _NF_CONNTRACK_BPF_H */ | 46 | #endif /* _NF_CONNTRACK_BPF_H */ |