diff mbox

[ovs-dev,6/6] datapath-windows: GENEVE Check for flow destination port

Message ID 20170110164810.7988-7-aserdean@cloudbasesolutions.com
State Accepted
Headers show

Commit Message

Alin Serdean Jan. 10, 2017, 4:48 p.m. UTC
Change the UDP destination port(GENEVE header) to check if it was set by
the userspace, use it if it was set.
If the userspace did not specify a destination port, use the configured
vport destination port.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
---
 datapath-windows/ovsext/Geneve.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/datapath-windows/ovsext/Geneve.c b/datapath-windows/ovsext/Geneve.c
index d38a656..1938aaa 100644
--- a/datapath-windows/ovsext/Geneve.c
+++ b/datapath-windows/ovsext/Geneve.c
@@ -201,7 +201,8 @@  NDIS_STATUS OvsEncapGeneve(POVS_VPORT_ENTRY vport,
         /* UDP header */
         udpHdr = (UDPHdr *)((PCHAR)ipHdr + sizeof *ipHdr);
         udpHdr->source = htons(tunKey->flow_hash | MAXINT16);
-        udpHdr->dest = htons(vportGeneve->dstPort);
+        udpHdr->dest = tunKey->dst_port ? tunKey->dst_port :
+                                          htons(vportGeneve->dstPort);
         udpHdr->len = htons(NET_BUFFER_DATA_LENGTH(curNb) - headRoom +
                             sizeof *udpHdr + sizeof *geneveHdr +
                             tunKey->tunOptLen);