diff mbox

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

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

Commit Message

Alin Serdean Jan. 10, 2017, 4:48 p.m. UTC
Change the TCP destination port(STT 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/Stt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Sairam Venugopal Jan. 31, 2017, 6:26 p.m. UTC | #1
Acked-by: Sairam Venugopal <vsairam@vmware.com>





On 1/10/17, 8:48 AM, "ovs-dev-bounces@openvswitch.org on behalf of Alin Serdean" <ovs-dev-bounces@openvswitch.org on behalf of aserdean@cloudbasesolutions.com> wrote:

>Change the TCP destination port(STT 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/Stt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c
>index 9da81dc..5aa8652 100644
>--- a/datapath-windows/ovsext/Stt.c
>+++ b/datapath-windows/ovsext/Stt.c
>@@ -308,7 +308,8 @@ OvsDoEncapStt(POVS_VPORT_ENTRY vport,
>         /* L4 header */
>         RtlZeroMemory(outerTcpHdr, sizeof *outerTcpHdr);
>         outerTcpHdr->source = htons(tunKey->flow_hash | 32768);
>-        outerTcpHdr->dest = htons(vportStt->dstPort);
>+        outerTcpHdr->dest = tunKey->dst_port ? tunKey->dst_port:
>+                                               htons(vportStt->dstPort);
>         outerTcpHdr->seq = htonl((STT_HDR_LEN + innerFrameLen) <<
>                                  STT_SEQ_LEN_SHIFT);
>         outerTcpHdr->ack_seq = htonl(atomic_inc64(&vportStt->ackNo));
>-- 
>2.10.2.windows.1
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=hBUOR4xEDx1_kXNf_w0UfXPyCRqbASz4TKv3Gcu8SjY&s=L1_elR78u6pHX6FjX3RUoYW1BH_aPfjfuZInfwRpdnA&e=
diff mbox

Patch

diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c
index 9da81dc..5aa8652 100644
--- a/datapath-windows/ovsext/Stt.c
+++ b/datapath-windows/ovsext/Stt.c
@@ -308,7 +308,8 @@  OvsDoEncapStt(POVS_VPORT_ENTRY vport,
         /* L4 header */
         RtlZeroMemory(outerTcpHdr, sizeof *outerTcpHdr);
         outerTcpHdr->source = htons(tunKey->flow_hash | 32768);
-        outerTcpHdr->dest = htons(vportStt->dstPort);
+        outerTcpHdr->dest = tunKey->dst_port ? tunKey->dst_port:
+                                               htons(vportStt->dstPort);
         outerTcpHdr->seq = htonl((STT_HDR_LEN + innerFrameLen) <<
                                  STT_SEQ_LEN_SHIFT);
         outerTcpHdr->ack_seq = htonl(atomic_inc64(&vportStt->ackNo));