diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-03-10 05:27:18 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-03-10 10:03:02 -0400 |
commit | 1a4ba64d16a42c1b31d52b671accd7f9103e2626 (patch) | |
tree | f1f61462f14d2017965dae56d82cd05d947cc854 /net/bridge/br_private.h | |
parent | a03a8dbe20eff6d57aae3147577bf84b52aba4e6 (diff) |
netfilter: bridge: use rcu hook to resolve br_netfilter dependency
e5de75b ("netfilter: bridge: move DNAT helper to br_netfilter") results
in the following link problem:
net/bridge/br_device.c:29: undefined reference to `br_nf_prerouting_finish_bridge`
Moreover it creates a hard dependency between br_netfilter and the
bridge core, which is what we've been trying to avoid so far.
Resolve this problem by using a hook structure so we reduce #ifdef
pollution and keep bridge netfilter specific code under br_netfilter.c
which was the original intention.
Reported-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r-- | net/bridge/br_private.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index f0a0438dbd6d..b46fa0c5b8ec 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -763,17 +763,17 @@ static inline int br_vlan_enabled(struct net_bridge *br) | |||
763 | } | 763 | } |
764 | #endif | 764 | #endif |
765 | 765 | ||
766 | struct nf_br_ops { | ||
767 | int (*br_dev_xmit_hook)(struct sk_buff *skb); | ||
768 | }; | ||
769 | extern const struct nf_br_ops __rcu *nf_br_ops; | ||
770 | |||
766 | /* br_netfilter.c */ | 771 | /* br_netfilter.c */ |
767 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) | 772 | #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) |
768 | int br_nf_prerouting_finish_bridge(struct sk_buff *skb); | ||
769 | int br_nf_core_init(void); | 773 | int br_nf_core_init(void); |
770 | void br_nf_core_fini(void); | 774 | void br_nf_core_fini(void); |
771 | void br_netfilter_rtable_init(struct net_bridge *); | 775 | void br_netfilter_rtable_init(struct net_bridge *); |
772 | #else | 776 | #else |
773 | static inline int br_nf_prerouting_finish_bridge(struct sk_buff *skb) | ||
774 | { | ||
775 | return 0; | ||
776 | } | ||
777 | static inline int br_nf_core_init(void) { return 0; } | 777 | static inline int br_nf_core_init(void) { return 0; } |
778 | static inline void br_nf_core_fini(void) {} | 778 | static inline void br_nf_core_fini(void) {} |
779 | #define br_netfilter_rtable_init(x) | 779 | #define br_netfilter_rtable_init(x) |