aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/arp.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/ipv4/arp.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/ipv4/arp.c')
-rw-r--r--net/ipv4/arp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index ae71e9ade5f9..61ff5ea31283 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -621,7 +621,7 @@ out:
621} 621}
622EXPORT_SYMBOL(arp_create); 622EXPORT_SYMBOL(arp_create);
623 623
624static int arp_xmit_finish(struct sock *sk, struct sk_buff *skb) 624static int arp_xmit_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
625{ 625{
626 return dev_queue_xmit(skb); 626 return dev_queue_xmit(skb);
627} 627}
@@ -642,7 +642,7 @@ EXPORT_SYMBOL(arp_xmit);
642 * Process an arp request. 642 * Process an arp request.
643 */ 643 */
644 644
645static int arp_process(struct sock *sk, struct sk_buff *skb) 645static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb)
646{ 646{
647 struct net_device *dev = skb->dev; 647 struct net_device *dev = skb->dev;
648 struct in_device *in_dev = __in_dev_get_rcu(dev); 648 struct in_device *in_dev = __in_dev_get_rcu(dev);
@@ -654,7 +654,6 @@ static int arp_process(struct sock *sk, struct sk_buff *skb)
654 u16 dev_type = dev->type; 654 u16 dev_type = dev->type;
655 int addr_type; 655 int addr_type;
656 struct neighbour *n; 656 struct neighbour *n;
657 struct net *net = dev_net(dev);
658 bool is_garp = false; 657 bool is_garp = false;
659 658
660 /* arp_rcv below verifies the ARP header and verifies the device 659 /* arp_rcv below verifies the ARP header and verifies the device
@@ -865,7 +864,7 @@ out:
865 864
866static void parp_redo(struct sk_buff *skb) 865static void parp_redo(struct sk_buff *skb)
867{ 866{
868 arp_process(NULL, skb); 867 arp_process(dev_net(skb->dev), NULL, skb);
869} 868}
870 869
871 870