diff options
author | Shashank Ram <rams@vmware.com> | 2017-11-20 15:06:14 -0800 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2017-11-28 14:46:57 +0200 |
commit | a9e6958101d082dbbdc096d01a803ab3a3eca549 (patch) | |
tree | f1ab1f649e5d086dc979eb8214da33379fec0b2e /datapath-windows/ovsext/Vxlan.h | |
parent | 8a7903c632ef940bcacaa7da7330e871912a6985 (diff) | |
download | openvswitch-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/Vxlan.h')
-rw-r--r-- | datapath-windows/ovsext/Vxlan.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Vxlan.h b/datapath-windows/ovsext/Vxlan.h index f4a8bceba..e2fb2dc08 100644 --- a/datapath-windows/ovsext/Vxlan.h +++ b/datapath-windows/ovsext/Vxlan.h @@ -85,6 +85,12 @@ OvsGetVxlanTunHdrSize(VOID) sizeof (VXLANHdr); } +static __inline UINT32 +OvsGetVxlanTunHdrSizeFromLayers(POVS_PACKET_HDR_INFO layers) +{ + return layers->l7Offset + sizeof(VXLANHdr); +} + #define VXLAN_UDP_PORT 4789 #define VXLAN_UDP_PORT_NBO 0xB512 |