netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joseph Gasparakis <joseph.gasparakis@intel.com>
To: davem@davemloft.net, shemminger@vyatta.com, chrisw@sous-sol.org
Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Subject: [PATCH 2/3] vxlan: capture inner headers during encapsulation
Date: Thu,  8 Nov 2012 18:18:02 -0800	[thread overview]
Message-ID: <1352427483-4380-3-git-send-email-joseph.gasparakis@intel.com> (raw)
In-Reply-To: <1352427483-4380-1-git-send-email-joseph.gasparakis@intel.com>

Populating the inner header pointers of skb for vxlan

Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---
 drivers/net/vxlan.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 030559d..14e6c8f 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -694,11 +694,23 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
 	__be16 df = 0;
 	__u8 tos, ttl;
 	int err;
+	unsigned int offset;
 
 	dst = vxlan_find_dst(vxlan, skb);
 	if (!dst)
 		goto drop;
 
+	offset = skb->data - skb->head;
+
+	skb_reset_inner_mac_header(skb);
+
+	if (skb->network_header)
+		skb_set_inner_network_header(skb, skb->network_header - offset);
+
+	if (skb->transport_header)
+		skb_set_inner_transport_header(skb, skb->transport_header -
+					      offset);
+
 	/* Need space for new headers (invalidates iph ptr) */
 	if (skb_cow_head(skb, VXLAN_HEADROOM))
 		goto drop;
-- 
1.7.11.7

  parent reply	other threads:[~2012-11-09  2:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  2:18 [PATCH net-next 0/3 ] tunneling: Add support for hardware-offloaded encapsulation Joseph Gasparakis
2012-11-09  2:18 ` [PATCH 1/3] net: " Joseph Gasparakis
2012-11-14 12:23   ` Dmitry Kravkov
2012-11-09  2:18 ` Joseph Gasparakis [this message]
2012-11-09  2:18 ` [PATCH 3/3] ipgre: capture inner headers during encapsulation Joseph Gasparakis
2012-11-11 15:18   ` Dmitry Kravkov
2012-11-12  1:47     ` Joseph Gasparakis

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=1352427483-4380-3-git-send-email-joseph.gasparakis@intel.com \
    --to=joseph.gasparakis@intel.com \
    --cc=chrisw@sous-sol.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=shemminger@vyatta.com \
    /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).