Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
[cascardo/linux.git] / net / bridge / br_device.c
index ffd379d..4ff77a1 100644 (file)
@@ -25,6 +25,9 @@
 #define COMMON_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | \
                         NETIF_F_GSO_MASK | NETIF_F_HW_CSUM)
 
+const struct nf_br_ops __rcu *nf_br_ops __read_mostly;
+EXPORT_SYMBOL_GPL(nf_br_ops);
+
 /* net device transmit always called with BH disabled */
 netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 {
@@ -33,16 +36,15 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
        struct net_bridge_fdb_entry *dst;
        struct net_bridge_mdb_entry *mdst;
        struct pcpu_sw_netstats *brstats = this_cpu_ptr(br->stats);
+       const struct nf_br_ops *nf_ops;
        u16 vid = 0;
 
        rcu_read_lock();
-#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
-       if (skb->nf_bridge && (skb->nf_bridge->mask & BRNF_BRIDGED_DNAT)) {
-               br_nf_pre_routing_finish_bridge_slow(skb);
+       nf_ops = rcu_dereference(nf_br_ops);
+       if (nf_ops && nf_ops->br_dev_xmit_hook(skb)) {
                rcu_read_unlock();
                return NETDEV_TX_OK;
        }
-#endif
 
        u64_stats_update_begin(&brstats->syncp);
        brstats->tx_packets++;