ipv4, ipv6: Pass net into __ip_local_out and __ip6_local_out
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 7 Oct 2015 21:48:45 +0000 (16:48 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Oct 2015 11:27:02 +0000 (04:27 -0700)
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vrf.c
include/net/dst_ops.h
include/net/ip.h
include/net/ipv6.h
net/ipv4/ip_output.c
net/ipv6/output_core.c
net/xfrm/xfrm_output.c

index 231f9d85d4eb6c886b7b307f8d796602e0576d08..b27dc11cd3f26410b2514a57ac9f50540944d591 100644 (file)
@@ -74,7 +74,7 @@ static struct dst_entry *vrf_ip_check(struct dst_entry *dst, u32 cookie)
        return dst;
 }
 
-static int vrf_ip_local_out(struct sock *sk, struct sk_buff *skb)
+static int vrf_ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
        return ip_local_out(sk, skb);
 }
index 3f26a6af444e257a4d2b9edad839a33c1b8f2d61..a0d443ca16fcca26b4925d477265935f5bdaf5bc 100644 (file)
@@ -9,6 +9,7 @@ struct kmem_cachep;
 struct net_device;
 struct sk_buff;
 struct sock;
+struct net;
 
 struct dst_ops {
        unsigned short          family;
@@ -28,7 +29,7 @@ struct dst_ops {
                                               struct sk_buff *skb, u32 mtu);
        void                    (*redirect)(struct dst_entry *dst, struct sock *sk,
                                            struct sk_buff *skb);
-       int                     (*local_out)(struct sock *sk, struct sk_buff *skb);
+       int                     (*local_out)(struct net *net, struct sock *sk, struct sk_buff *skb);
        struct neighbour *      (*neigh_lookup)(const struct dst_entry *dst,
                                                struct sk_buff *skb,
                                                const void *daddr);
index 03e80f9368474d5115ad68dd24326f4c86e5871c..34b40381fb9ba056a3c189ffc49b6323711ab765 100644 (file)
@@ -112,7 +112,7 @@ int ip_mc_output(struct sock *sk, struct sk_buff *skb);
 int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
                   int (*output)(struct net *, struct sock *, struct sk_buff *));
 void ip_send_check(struct iphdr *ip);
-int __ip_local_out(struct sock *sk, struct sk_buff *skb);
+int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
 int ip_local_out(struct sock *sk, struct sk_buff *skb);
 
 int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
index 30eb1821c184e74b6fd8e62c9e40f6da2c7c9ac7..42834039cf20b7ade04ca4c37b32576dda9ffc7e 100644 (file)
@@ -865,7 +865,7 @@ int ip6_forward(struct sk_buff *skb);
 int ip6_input(struct sk_buff *skb);
 int ip6_mc_input(struct sk_buff *skb);
 
-int __ip6_local_out(struct sock *sk, struct sk_buff *skb);
+int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
 int ip6_local_out(struct sock *sk, struct sk_buff *skb);
 
 /*
index a7012f2fa68a9ca9e1c74c3163ec5d29b145fae6..39d3fbe66c6822904f940b7fa4e1dd42a70859ea 100644 (file)
@@ -96,9 +96,8 @@ void ip_send_check(struct iphdr *iph)
 }
 EXPORT_SYMBOL(ip_send_check);
 
-int __ip_local_out(struct sock *sk, struct sk_buff *skb)
+int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
-       struct net *net = dev_net(skb_dst(skb)->dev);
        struct iphdr *iph = ip_hdr(skb);
 
        iph->tot_len = htons(skb->len);
@@ -113,7 +112,7 @@ int ip_local_out(struct sock *sk, struct sk_buff *skb)
        struct net *net = dev_net(skb_dst(skb)->dev);
        int err;
 
-       err = __ip_local_out(sk, skb);
+       err = __ip_local_out(net, sk, skb);
        if (likely(err == 1))
                err = dst_output(net, sk, skb);
 
index 12855811c6a0526fac04ffa69fd3bbe1e41af0ff..7f64d67b637d8764eec3dc00cadf97201deb77a4 100644 (file)
@@ -138,9 +138,8 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
 EXPORT_SYMBOL(ip6_dst_hoplimit);
 #endif
 
-int __ip6_local_out(struct sock *sk, struct sk_buff *skb)
+int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
-       struct net *net = dev_net(skb_dst(skb)->dev);
        int len;
 
        len = skb->len - sizeof(struct ipv6hdr);
@@ -160,7 +159,7 @@ int ip6_local_out(struct sock *sk, struct sk_buff *skb)
        struct net *net = dev_net(skb_dst(skb)->dev);
        int err;
 
-       err = __ip6_local_out(sk, skb);
+       err = __ip6_local_out(net, sk, skb);
        if (likely(err == 1))
                err = dst_output(net, sk, skb);
 
index a7a254fe79851feb8ed7db26b6e26416f2ec974f..cc3676eb6239707909e41c34841abbd4ea8958dd 100644 (file)
@@ -136,7 +136,7 @@ int xfrm_output_resume(struct sk_buff *skb, int err)
        while (likely((err = xfrm_output_one(skb, err)) == 0)) {
                nf_reset(skb);
 
-               err = skb_dst(skb)->ops->local_out(skb->sk, skb);
+               err = skb_dst(skb)->ops->local_out(net, skb->sk, skb);
                if (unlikely(err != 1))
                        goto out;
 
This page took 0.031075 seconds and 5 git commands to generate.