datapath-windows: Allow encapsulation if source is bridge-internal port.
authorNithin Raju <nithin@vmware.com>
Fri, 24 Oct 2014 18:41:17 +0000 (11:41 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 28 Oct 2014 16:13:48 +0000 (09:13 -0700)
It has been observed that when userspace generates and executes that
packet, the source port of such a packet is set to the bridge-internal
port. Currently, we allow encapsulation only if the source port is a VIF
port or no port. We relax the check in this patch.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/Actions.c

index 14d1f8f..dfa5ecb 100644 (file)
@@ -266,8 +266,10 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx,
         /*
          * Tx:
          * The destination port is a tunnel port. Encapsulation must be
-         * performed only on packets that originate from a VIF port or from
-         * userspace (default port)
+         * performed only on packets that originate from:
+         * - a VIF port
+         * - a bridge-internal port (packets generated from userspace)
+         * - no port.
          *
          * If the packet will not be encapsulated, consume the tunnel context
          * by clearing it.
@@ -277,7 +279,9 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx,
             POVS_VPORT_ENTRY vport = OvsFindVportByPortNo(
                 ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo);
 
-            if (!vport || vport->ovsType != OVS_VPORT_TYPE_NETDEV) {
+            if (!vport ||
+                (vport->ovsType != OVS_VPORT_TYPE_NETDEV &&
+                 !OvsIsBridgeInternalVport(vport))) {
                 ovsFwdCtx->tunKey.dst = 0;
             }
         }