diff options
author | Anand Kumar <kumaranand@vmware.com> | 2017-10-19 13:26:17 -0700 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2017-10-20 19:11:40 +0300 |
commit | 01d630280078991384544b4dae8f6127806cce3c (patch) | |
tree | 9622a993611944793f1ee2c40328cca84e2ccc6f /datapath-windows/ovsext/Geneve.c | |
parent | 94cd8383e2975a3da25028162bf5d69d308af6fb (diff) | |
download | openvswitch-01d630280078991384544b4dae8f6127806cce3c.tar.gz |
datapath-windows: Update OvsIPv4TunnelKey flags in geneve decap.
Currently, the OvsLookupFlow fails for the decap packet,
when the Geneve options are present in the packet as the OvsIPv4TunnelKey
flags are not set in the Geneve decap.
Set the OvsIPv4TunnelKey flags OVS_TNL_F_OAM and OVS_TNL_F_CRT_OPT
in OvsDecapGeneve based on the geneve header. Also set OVS_TNL_F_GENEVE_OPT
if the packet has geneve options.
Signed-off-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Geneve.c')
-rw-r--r-- | datapath-windows/ovsext/Geneve.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/datapath-windows/ovsext/Geneve.c b/datapath-windows/ovsext/Geneve.c index 43374e232..6dca69bc7 100644 --- a/datapath-windows/ovsext/Geneve.c +++ b/datapath-windows/ovsext/Geneve.c @@ -324,10 +324,10 @@ NDIS_STATUS OvsDecapGeneve(POVS_SWITCH_CONTEXT switchContext, status = STATUS_NDIS_INVALID_PACKET; goto dropNbl; } - tunKey->flags = OVS_TNL_F_KEY; - if (geneveHdr->oam) { - tunKey->flags |= OVS_TNL_F_OAM; - } + /* Update tunnelKey flags. */ + tunKey->flags = OVS_TNL_F_KEY | (geneveHdr->oam ? OVS_TNL_F_OAM : 0) | + (geneveHdr->critical ? OVS_TNL_F_CRT_OPT : 0); + tunKey->tunnelId = GENEVE_VNI_TO_TUNNELID(geneveHdr->vni); tunKey->tunOptLen = (uint8)geneveHdr->optLen * 4; if (tunKey->tunOptLen > TUN_OPT_MAX_LEN || @@ -349,6 +349,7 @@ NDIS_STATUS OvsDecapGeneve(POVS_SWITCH_CONTEXT switchContext, memcpy(TunnelKeyGetOptions(tunKey), optStart, tunKey->tunOptLen); } NdisAdvanceNetBufferDataStart(curNb, tunKey->tunOptLen, FALSE, NULL); + tunKey->flags |= OVS_TNL_F_GENEVE_OPT; } return NDIS_STATUS_SUCCESS; |