diff options
author | Luka Perkov <luka@openwrt.org> | 2015-04-11 10:28:14 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2015-04-11 10:28:14 +0000 |
commit | 4398ecd73dcf8554c0e495de082e4677440c1d5c (patch) | |
tree | e24faee648bd7fe02dcdb4a9f916f88324797735 /target/linux/generic/patches-3.14/644-bridge_optimize_netfilter_hooks.patch | |
parent | adb7aa14be1321e4ee57b2564edeb558d7eedcda (diff) | |
download | master-187ad058-4398ecd73dcf8554c0e495de082e4677440c1d5c.tar.gz master-187ad058-4398ecd73dcf8554c0e495de082e4677440c1d5c.tar.bz2 master-187ad058-4398ecd73dcf8554c0e495de082e4677440c1d5c.zip |
generic: drop 3.14
Signed-off-by: Luka Perkov <luka@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45375 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-3.14/644-bridge_optimize_netfilter_hooks.patch')
-rw-r--r-- | target/linux/generic/patches-3.14/644-bridge_optimize_netfilter_hooks.patch | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/target/linux/generic/patches-3.14/644-bridge_optimize_netfilter_hooks.patch b/target/linux/generic/patches-3.14/644-bridge_optimize_netfilter_hooks.patch deleted file mode 100644 index 6948fcf6cb..0000000000 --- a/target/linux/generic/patches-3.14/644-bridge_optimize_netfilter_hooks.patch +++ /dev/null @@ -1,155 +0,0 @@ ---- a/net/bridge/br_forward.c -+++ b/net/bridge/br_forward.c -@@ -57,7 +57,7 @@ int br_dev_queue_push_xmit(struct sk_buf - - int br_forward_finish(struct sk_buff *skb) - { -- return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev, -+ return BR_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, skb, NULL, skb->dev, - br_dev_queue_push_xmit); - - } -@@ -80,7 +80,7 @@ static void __br_deliver(const struct ne - return; - } - -- NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, -+ BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, - br_forward_finish); - } - -@@ -101,7 +101,7 @@ static void __br_forward(const struct ne - skb->dev = to->dev; - skb_forward_csum(skb); - -- NF_HOOK(NFPROTO_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, -+ BR_HOOK(NFPROTO_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, - br_forward_finish); - } - ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -53,7 +53,7 @@ static int br_pass_frame_up(struct sk_bu - if (!skb) - return NET_RX_DROP; - -- return NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, -+ return BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, - netif_receive_skb); - } - -@@ -214,7 +214,7 @@ rx_handler_result_t br_handle_frame(stru - } - - /* Deliver packet to local host only */ -- if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, -+ if (BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, - NULL, br_handle_local_finish)) { - return RX_HANDLER_CONSUMED; /* consumed by filter */ - } else { -@@ -229,7 +229,7 @@ forward: - if (ether_addr_equal(p->br->dev->dev_addr, dest)) - skb->pkt_type = PACKET_HOST; - -- if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, -+ if (BR_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, - br_handle_local_finish)) - break; - -@@ -251,7 +251,7 @@ forward: - if (ether_addr_equal(p->br->dev->dev_addr, dest)) - skb->pkt_type = PACKET_HOST; - -- NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, -+ BR_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, - br_handle_frame_finish); - break; - default: ---- a/net/bridge/br_multicast.c -+++ b/net/bridge/br_multicast.c -@@ -802,7 +802,7 @@ static void __br_multicast_send_query(st - if (port) { - __skb_push(skb, sizeof(struct ethhdr)); - skb->dev = port->dev; -- NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, -+ BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, - dev_queue_xmit); - } else - netif_rx(skb); ---- a/net/bridge/br_netfilter.c -+++ b/net/bridge/br_netfilter.c -@@ -73,6 +73,15 @@ static int brnf_pass_vlan_indev __read_m - #define IS_ARP(skb) \ - (!vlan_tx_tag_present(skb) && skb->protocol == htons(ETH_P_ARP)) - -+int brnf_call_ebtables __read_mostly = 0; -+EXPORT_SYMBOL_GPL(brnf_call_ebtables); -+ -+bool br_netfilter_run_hooks(void) -+{ -+ return brnf_call_iptables | brnf_call_ip6tables | brnf_call_arptables | -+ brnf_call_ebtables; -+} -+ - static inline __be16 vlan_proto(const struct sk_buff *skb) - { - if (vlan_tx_tag_present(skb)) ---- a/net/bridge/br_private.h -+++ b/net/bridge/br_private.h -@@ -727,15 +727,29 @@ static inline u16 br_get_pvid(const stru - - /* br_netfilter.c */ - #ifdef CONFIG_BRIDGE_NETFILTER -+extern int brnf_call_ebtables; - int br_netfilter_init(void); - void br_netfilter_fini(void); - void br_netfilter_rtable_init(struct net_bridge *); -+bool br_netfilter_run_hooks(void); - #else - #define br_netfilter_init() (0) - #define br_netfilter_fini() do { } while (0) - #define br_netfilter_rtable_init(x) -+#define br_netfilter_run_hooks() false - #endif - -+static inline int -+BR_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb, -+ struct net_device *in, struct net_device *out, -+ int (*okfn)(struct sk_buff *)) -+{ -+ if (!br_netfilter_run_hooks()) -+ return okfn(skb); -+ -+ return NF_HOOK(pf, hook, skb, in, out, okfn); -+} -+ - /* br_stp.c */ - void br_log_state(const struct net_bridge_port *p); - struct net_bridge_port *br_get_port(struct net_bridge *br, u16 port_no); ---- a/net/bridge/br_stp_bpdu.c -+++ b/net/bridge/br_stp_bpdu.c -@@ -54,7 +54,7 @@ static void br_send_bpdu(struct net_brid - - skb_reset_mac_header(skb); - -- NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, -+ BR_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, - dev_queue_xmit); - } - ---- a/net/bridge/netfilter/ebtables.c -+++ b/net/bridge/netfilter/ebtables.c -@@ -2405,11 +2405,13 @@ static int __init ebtables_init(void) - } - - printk(KERN_INFO "Ebtables v2.0 registered\n"); -+ brnf_call_ebtables = 1; - return 0; - } - - static void __exit ebtables_fini(void) - { -+ brnf_call_ebtables = 0; - nf_unregister_sockopt(&ebt_sockopts); - xt_unregister_target(&ebt_standard_target); - printk(KERN_INFO "Ebtables v2.0 unregistered\n"); |