dst: Pass a sk into .local_out
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 7 Oct 2015 21:48:36 +0000 (16:48 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Oct 2015 11:26:55 +0000 (04:26 -0700)
For consistency with the other similar methods in the kernel pass a
struct sock into the dst_ops .local_out method.

Simplifying the socket passing case is needed a prequel to passing a
struct net reference into .local_out.

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/ipv4/route.c
net/ipv4/xfrm4_policy.c
net/ipv6/output_core.c
net/ipv6/route.c
net/ipv6/xfrm6_policy.c
net/xfrm/xfrm_output.c

index 64499766e00f64255ece98727d382064e621e909..1039eb5f6c2abb88ccd45bfef8382ec545872b64 100644 (file)
@@ -74,9 +74,9 @@ static struct dst_entry *vrf_ip_check(struct dst_entry *dst, u32 cookie)
        return dst;
 }
 
-static int vrf_ip_local_out(struct sk_buff *skb)
+static int vrf_ip_local_out(struct sock *sk, struct sk_buff *skb)
 {
-       return ip_local_out(skb);
+       return ip_local_out_sk(sk, skb);
 }
 
 static unsigned int vrf_v4_mtu(const struct dst_entry *dst)
index d64253914a6ab6406d92becb4c44fbdec8af17e2..3f26a6af444e257a4d2b9edad839a33c1b8f2d61 100644 (file)
@@ -28,7 +28,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 sk_buff *skb);
+       int                     (*local_out)(struct sock *sk, struct sk_buff *skb);
        struct neighbour *      (*neigh_lookup)(const struct dst_entry *dst,
                                                struct sk_buff *skb,
                                                const void *daddr);
index dd06ab3669f9d4d38ea1e7cb8e0053516943566c..ea1f721f7224dc52a08b229f7e950eee2fff5b95 100644 (file)
@@ -112,6 +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_sk(struct sock *sk, struct sk_buff *skb);
 int __ip_local_out(struct sk_buff *skb);
 int ip_local_out_sk(struct sock *sk, struct sk_buff *skb);
 static inline int ip_local_out(struct sk_buff *skb)
index 3dde042bcd3fc4db7efe95207a4c7b0708e1aed2..56920262dbe9da428eac31e911df8ef591eed009 100644 (file)
@@ -865,6 +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_sk(struct sock *sk, struct sk_buff *skb);
 int __ip6_local_out(struct sk_buff *skb);
 int ip6_local_out_sk(struct sock *sk, struct sk_buff *skb);
 int ip6_local_out(struct sk_buff *skb);
index c94efb22f380cb34df658382614e5d63175ae0c3..c38dfd7404fbb54065c924121601177b70998fb5 100644 (file)
@@ -96,7 +96,7 @@ void ip_send_check(struct iphdr *iph)
 }
 EXPORT_SYMBOL(ip_send_check);
 
-static int __ip_local_out_sk(struct sock *sk, struct sk_buff *skb)
+int __ip_local_out_sk(struct sock *sk, struct sk_buff *skb)
 {
        struct net *net = dev_net(skb_dst(skb)->dev);
        struct iphdr *iph = ip_hdr(skb);
index bf1486bd7e811d64d5c4a69173dfa9c64a877456..638b976008b7d5946bc56ee2caeff7e93164ae4a 100644 (file)
@@ -165,7 +165,7 @@ static struct dst_ops ipv4_dst_ops = {
        .link_failure =         ipv4_link_failure,
        .update_pmtu =          ip_rt_update_pmtu,
        .redirect =             ip_do_redirect,
-       .local_out =            __ip_local_out,
+       .local_out =            __ip_local_out_sk,
        .neigh_lookup =         ipv4_neigh_lookup,
 };
 
index f2606b9056bb1b3f4e3038328b62a97895dbd566..d46d99f9cabd05216085aa2ad78f53bb985272d6 100644 (file)
@@ -243,7 +243,7 @@ static struct dst_ops xfrm4_dst_ops = {
        .cow_metrics =          dst_cow_metrics_generic,
        .destroy =              xfrm4_dst_destroy,
        .ifdown =               xfrm4_dst_ifdown,
-       .local_out =            __ip_local_out,
+       .local_out =            __ip_local_out_sk,
        .gc_thresh =            32768,
 };
 
index 4337147ee23d9fcf8a3f4d2d98377bbce9f389fb..e5affb5fe09516c1856a50deafbea53917fd0976 100644 (file)
@@ -138,7 +138,7 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
 EXPORT_SYMBOL(ip6_dst_hoplimit);
 #endif
 
-static int __ip6_local_out_sk(struct sock *sk, struct sk_buff *skb)
+int __ip6_local_out_sk(struct sock *sk, struct sk_buff *skb)
 {
        struct net *net = dev_net(skb_dst(skb)->dev);
        int len;
index d3d946773a3e8caa3dddbcdaef222b3bb9efa59e..b62a507cc1a510ac642b0b83040fa2e44965096e 100644 (file)
@@ -226,7 +226,7 @@ static struct dst_ops ip6_dst_ops_template = {
        .link_failure           =       ip6_link_failure,
        .update_pmtu            =       ip6_rt_update_pmtu,
        .redirect               =       rt6_do_redirect,
-       .local_out              =       __ip6_local_out,
+       .local_out              =       __ip6_local_out_sk,
        .neigh_lookup           =       ip6_neigh_lookup,
 };
 
index 08c9c93f352737ba21eebad04f6e8b3f268dbdde..f7876830f263b756a099d24d11c77a30f99180d0 100644 (file)
@@ -285,7 +285,7 @@ static struct dst_ops xfrm6_dst_ops = {
        .cow_metrics =          dst_cow_metrics_generic,
        .destroy =              xfrm6_dst_destroy,
        .ifdown =               xfrm6_dst_ifdown,
-       .local_out =            __ip6_local_out,
+       .local_out =            __ip6_local_out_sk,
        .gc_thresh =            32768,
 };
 
index 88752b0c07d80581fcc9bf65f6f798b53194d614..a7a254fe79851feb8ed7db26b6e26416f2ec974f 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);
+               err = skb_dst(skb)->ops->local_out(skb->sk, skb);
                if (unlikely(err != 1))
                        goto out;
 
This page took 0.031394 seconds and 5 git commands to generate.