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>
/*
* 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.
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;
}
}