summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Geneve.h
diff options
context:
space:
mode:
authorShashank Ram <rams@vmware.com>2017-11-20 15:06:14 -0800
committerAlin Gabriel Serdean <aserdean@ovn.org>2017-11-28 14:46:57 +0200
commita9e6958101d082dbbdc096d01a803ab3a3eca549 (patch)
treef1ab1f649e5d086dc979eb8214da33379fec0b2e /datapath-windows/ovsext/Geneve.h
parent8a7903c632ef940bcacaa7da7330e871912a6985 (diff)
downloadopenvswitch-a9e6958101d082dbbdc096d01a803ab3a3eca549.tar.gz
datapath-windows: Account for VLAN tag in tunnel Decap
Decap functions for tunneling protocols do not compute the packet header offsets correctly when there is a VLAN tag in the L2 header. This results in incorrect checksum computation causing the packet to be dropped. This patch adds support to account for the VLAN tag in the packet if its present, and makes use of the OvsExtractLayers() function to correctly compute the header offsets for different layers. Testing done: - Tested Geneve, STT, Vxlan and Gre and verified that there are no regressions. - Verified that packets with VLAN tags are correctly handled in the decap code of all tunneling protocols. Previously, this would result in packet drops due to invalid checksums being computed. - Verified that non-VLAN tagged packets are handled correctly. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Geneve.h')
-rw-r--r--datapath-windows/ovsext/Geneve.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Geneve.h b/datapath-windows/ovsext/Geneve.h
index 019c0dd9f..db758dd07 100644
--- a/datapath-windows/ovsext/Geneve.h
+++ b/datapath-windows/ovsext/Geneve.h
@@ -113,6 +113,12 @@ OvsGetGeneveTunHdrMaxSize(VOID)
return OvsGetGeneveTunHdrMinSize() + TUN_OPT_MAX_LEN;
}
+static __inline UINT32
+OvsGetGeneveTunHdrSizeFromLayers(POVS_PACKET_HDR_INFO layers)
+{
+ return layers->l7Offset + sizeof(GeneveHdr);
+}
+
#define GENEVE_UDP_PORT 6081
#define GENEVE_UDP_PORT_NBO 0xC117
#define GENEVE_VER 0