From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
yoshfuji@linux-ipv6.org, stephen@networkplumber.org,
cwang@twopensource.com, pshelar@nicira.com,
nicolas.dichtel@6wind.com, therbert@google.com,
dborkman@redhat.com, edumazet@google.com
Subject: [patch net-next 2/3] vxlan: propagate sock pointer to ip6tunnel_xmit path
Date: Fri, 15 Aug 2014 20:32:55 +0200 [thread overview]
Message-ID: <1408127576-11518-2-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1408127576-11518-1-git-send-email-jiri@resnulli.us>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
drivers/net/vxlan.c | 2 +-
include/net/ip6_tunnel.h | 5 +++--
include/net/ipv6.h | 6 +++++-
net/ipv6/ip6_gre.c | 2 +-
net/ipv6/ip6_tunnel.c | 2 +-
net/ipv6/output_core.c | 6 +++---
6 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 1fb7b37..94bfa8e 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1652,7 +1652,7 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,
ip6h->daddr = *daddr;
ip6h->saddr = *saddr;
- ip6tunnel_xmit(skb, dev);
+ ip6tunnel_xmit(vs->sock->sk, skb, dev);
return 0;
}
#endif
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index a5593da..ba1506e 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -70,13 +70,14 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw);
__u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr,
const struct in6_addr *raddr);
-static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
+static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
+ struct net_device *dev)
{
struct net_device_stats *stats = &dev->stats;
int pkt_len, err;
pkt_len = skb->len;
- err = ip6_local_out(skb);
+ err = ip6_local_out_sk(sk, skb);
if (net_xmit_eval(err) == 0) {
struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index e8ac138..135cd58 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -802,7 +802,11 @@ int ip6_input(struct sk_buff *skb);
int ip6_mc_input(struct sk_buff *skb);
int __ip6_local_out(struct sk_buff *skb);
-int ip6_local_out(struct sk_buff *skb);
+int ip6_local_out_sk(struct sock *sk, struct sk_buff *skb);
+static inline int ip6_local_out(struct sk_buff *skb)
+{
+ return ip6_local_out_sk(skb->sk, skb);
+}
/*
* Extension header (options) processing
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 5f19dfb..fd0812b 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -754,7 +754,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
}
}
- ip6tunnel_xmit(skb, dev);
+ ip6tunnel_xmit(skb->sk, skb, dev);
if (ndst)
ip6_tnl_dst_store(tunnel, ndst);
return 0;
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index f9de5a6..5e8691b 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1053,7 +1053,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
ipv6h->nexthdr = proto;
ipv6h->saddr = fl6->saddr;
ipv6h->daddr = fl6->daddr;
- ip6tunnel_xmit(skb, dev);
+ ip6tunnel_xmit(skb->sk, skb, dev);
if (ndst)
ip6_tnl_dst_store(t, ndst);
return 0;
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index d746f75..8d3e9fb 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -85,14 +85,14 @@ int __ip6_local_out(struct sk_buff *skb)
}
EXPORT_SYMBOL_GPL(__ip6_local_out);
-int ip6_local_out(struct sk_buff *skb)
+int ip6_local_out_sk(struct sock *sk, struct sk_buff *skb)
{
int err;
err = __ip6_local_out(skb);
if (likely(err == 1))
- err = dst_output(skb);
+ err = dst_output_sk(sk, skb);
return err;
}
-EXPORT_SYMBOL_GPL(ip6_local_out);
+EXPORT_SYMBOL_GPL(ip6_local_out_sk);
--
1.9.3
next prev parent reply other threads:[~2014-08-15 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-15 18:32 [patch net-next 1/3] net: propagate sock pointer through netfilter hooks Jiri Pirko
2014-08-15 18:32 ` Jiri Pirko [this message]
2014-08-15 18:32 ` [patch net-next 3/3] ipv6: check propagates sk in sk_mc_loop instead of skb->sk Jiri Pirko
2014-08-22 0:33 ` [patch net-next 1/3] net: propagate sock pointer through netfilter hooks David Miller
2014-08-22 5:56 ` Jiri Pirko
2014-08-25 14:05 ` Jiri Pirko
2014-08-25 18:51 ` David Miller
2014-08-25 19:29 ` Jiri Pirko
2014-08-25 19:52 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408127576-11518-2-git-send-email-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=edumazet@google.com \
--cc=jmorris@namei.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pshelar@nicira.com \
--cc=stephen@networkplumber.org \
--cc=therbert@google.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).