Skip to content

Commit

Permalink
datapath-windows: Fix various Geneve bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Yin Lin <[email protected]>
Acked-by: Nithin Raju <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
Signed-off-by: Gurucharan Shetty <[email protected]>
  • Loading branch information
linyinvmware authored and shettyg committed Jul 21, 2016
1 parent ff188ad commit 9e23ac2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datapath-windows/ovsext/Flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ OvsTunnelAttrToGeneveOptions(PNL_ATTR attr,
option = (GeneveOptionHdr *)((UINT8 *)option + len);
optLen -= len;
}
memcpy(TunnelKeyGetOptions(tunKey), option, optLen);
memcpy(TunnelKeyGetOptions(tunKey), NlAttrData(attr), tunKey->tunOptLen);
if (isCritical) {
tunKey->flags |= OVS_TNL_F_CRT_OPT;
}
Expand Down
3 changes: 2 additions & 1 deletion datapath-windows/ovsext/Vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,8 @@ OvsFindTunnelVportByDstPortAndNWProto(POVS_SWITCH_CONTEXT switchContext,
if (GetPortFromPriv(vport) == dstPort) {
switch (nwProto) {
case IPPROTO_UDP:
if (vport->ovsType != OVS_VPORT_TYPE_VXLAN) {
if (vport->ovsType != OVS_VPORT_TYPE_GENEVE &&
vport->ovsType != OVS_VPORT_TYPE_VXLAN) {
continue;
}
break;
Expand Down
5 changes: 5 additions & 0 deletions datapath-windows/ovsext/Vport.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "Stt.h"
#include "Switch.h"
#include "VxLan.h"
#include "Geneve.h"

#define OVS_MAX_DPPORTS MAXUINT16
#define OVS_DPPORT_NUMBER_INVALID OVS_MAX_DPPORTS
Expand Down Expand Up @@ -183,6 +184,7 @@ static __inline BOOLEAN
OvsIsTunnelVportType(OVS_VPORT_TYPE ovsType)
{
return ovsType == OVS_VPORT_TYPE_VXLAN ||
ovsType == OVS_VPORT_TYPE_GENEVE ||
ovsType == OVS_VPORT_TYPE_STT ||
ovsType == OVS_VPORT_TYPE_GRE;
}
Expand Down Expand Up @@ -270,6 +272,9 @@ GetPortFromPriv(POVS_VPORT_ENTRY vport)
case OVS_VPORT_TYPE_VXLAN:
dstPort = ((POVS_VXLAN_VPORT)vportPriv)->dstPort;
break;
case OVS_VPORT_TYPE_GENEVE:
dstPort = ((POVS_GENEVE_VPORT) vportPriv)->dstPort;
break;
default:
ASSERT(! "Port is not a tunnel port");
}
Expand Down

0 comments on commit 9e23ac2

Please sign in to comment.