[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1351193940-11427-3-git-send-email-joseph.gasparakis@intel.com>
Date: Thu, 25 Oct 2012 12:39:00 -0700
From: Joseph Gasparakis <joseph.gasparakis@...el.com>
To: davem@...emloft.net, shemminger@...tta.com, chrisw@...s-sol.org
Cc: Joseph Gasparakis <joseph.gasparakis@...el.com>,
netdev@...r.kernel.org
Subject: [RFC PATCH v2 2/2] tunneling: capture inner headers during encapsulation
Populating the inner header pointers of skb for vxlan and ipgre
---
drivers/net/vxlan.c | 4 ++++
net/ipv4/ip_gre.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 51de9ed..7cd1e5a 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -647,6 +647,10 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
__u8 tos, ttl;
int err;
+ skb->inner_mac_header = skb->mac_header;
+ skb->inner_network_header = skb->network_header;
+ skb->inner_transport_header = skb->transport_header;
+
/* Need space for new headers (invalidates iph ptr) */
if (skb_cow_head(skb, VXLAN_HEADROOM))
goto drop;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 7240f8e..b20ff8f 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -902,6 +902,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
tunnel->err_count = 0;
}
+ skb->inner_mac_header = skb->mac_header;
+ skb->inner_network_header = skb->network_header;
+ skb->inner_transport_header = skb->transport_header;
+
max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->dst.header_len;
if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists