Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757457Ab2KICKf (ORCPT ); Thu, 8 Nov 2012 21:10:35 -0500 Received: from mga02.intel.com ([134.134.136.20]:36750 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756372Ab2KICKb (ORCPT ); Thu, 8 Nov 2012 21:10:31 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,741,1344236400"; d="scan'208";a="217073495" From: Joseph Gasparakis To: davem@davemloft.net, shemminger@vyatta.com, chrisw@sous-sol.org Cc: Joseph Gasparakis , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Peter P Waskiewicz Jr Subject: [PATCH 2/3] vxlan: capture inner headers during encapsulation Date: Thu, 8 Nov 2012 18:18:02 -0800 Message-Id: <1352427483-4380-3-git-send-email-joseph.gasparakis@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1352427483-4380-1-git-send-email-joseph.gasparakis@intel.com> References: <1352427483-4380-1-git-send-email-joseph.gasparakis@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 44 Populating the inner header pointers of skb for vxlan Signed-off-by: Joseph Gasparakis Signed-off-by: Peter P Waskiewicz Jr --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/