In one typical setup, on the Windows VM running OVS Windows Kernel, a Geneva
packet with 8021.q VLAN tag is received. Then it may do POP_VLAN action
processing in Actions.c, if the packet does not have Ieee8021QNetBufferListInfo
in the oob of the packet, it will be processed by function OvsPopVlanInPktBuf().
In the function it will go on remove VLAN header present in the nbl, but related
layers is never readjusted for the offset value at this moment. As a result, it
will cause function OvsValidateIPChecksum drop the packet.

Reported-at:https://github.com/openvswitch/ovs-issues/issues/225
Signed-off-by: wilsonpeng <pweis...@vmware.com>
---
 datapath-windows/ovsext/Actions.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/datapath-windows/ovsext/Actions.c 
b/datapath-windows/ovsext/Actions.c
index e130c2f96..a9e486752 100644
--- a/datapath-windows/ovsext/Actions.c
+++ b/datapath-windows/ovsext/Actions.c
@@ -1122,6 +1122,13 @@ OvsPopFieldInPacketBuf(OvsForwardingContext *ovsFwdCtx,
 
     if (bufferData) {
         *bufferData = bufferStart + shiftLength;
+    } else {
+        /* Currently !bufferData means it should be treated as VLAN;
+         * Adjust layers Offset value as the vlan tag is removed
+         */
+        OVS_PACKET_HDR_INFO *layers = &ovsFwdCtx->layers;
+        layers->l3Offset -= (UINT16)shiftLength;
+        layers->l4Offset -= (UINT16)shiftLength;
     }
 
     return NDIS_STATUS_SUCCESS;
-- 
2.17.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to