aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_input.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-09-15 21:04:18 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-17 20:18:37 -0400
commit0c4b51f0054ce85c0ec578ab818f0631834573eb (patch)
tree73e729f58fbaf6420e0f390e36aa936ddaa219ef /net/bridge/br_input.c
parent9dff2c966a0a79a4222553a851f17e679fc28a43 (diff)
netfilter: Pass net into okfn
This is immediately motivated by the bridge code that chains functions that call into netfilter. Without passing net into the okfns the bridge code would need to guess about the best expression for the network namespace to process packets in. As net is frequently one of the first things computed in continuation functions after netfilter has done it's job passing in the desired network namespace is in many cases a code simplification. To support this change the function dst_output_okfn is introduced to simplify passing dst_output as an okfn. For the moment dst_output_okfn just silently drops the struct net. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_input.c')
-rw-r--r--net/bridge/br_input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 78fa7acd836e..223f4040d9df 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -26,7 +26,8 @@
26br_should_route_hook_t __rcu *br_should_route_hook __read_mostly; 26br_should_route_hook_t __rcu *br_should_route_hook __read_mostly;
27EXPORT_SYMBOL(br_should_route_hook); 27EXPORT_SYMBOL(br_should_route_hook);
28 28
29static int br_netif_receive_skb(struct sock *sk, struct sk_buff *skb) 29static int
30br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
30{ 31{
31 return netif_receive_skb(skb); 32 return netif_receive_skb(skb);
32} 33}
@@ -125,7 +126,7 @@ static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,
125} 126}
126 127
127/* note: already called with rcu_read_lock */ 128/* note: already called with rcu_read_lock */
128int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb) 129int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
129{ 130{
130 const unsigned char *dest = eth_hdr(skb)->h_dest; 131 const unsigned char *dest = eth_hdr(skb)->h_dest;
131 struct net_bridge_port *p = br_port_get_rcu(skb->dev); 132 struct net_bridge_port *p = br_port_get_rcu(skb->dev);
@@ -213,7 +214,7 @@ drop:
213EXPORT_SYMBOL_GPL(br_handle_frame_finish); 214EXPORT_SYMBOL_GPL(br_handle_frame_finish);
214 215
215/* note: already called with rcu_read_lock */ 216/* note: already called with rcu_read_lock */
216static int br_handle_local_finish(struct sock *sk, struct sk_buff *skb) 217static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
217{ 218{
218 struct net_bridge_port *p = br_port_get_rcu(skb->dev); 219 struct net_bridge_port *p = br_port_get_rcu(skb->dev);
219 u16 vid = 0; 220 u16 vid = 0;