datapath-windows: Fix small bug in MPLS
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Thu, 11 Feb 2016 00:14:32 +0000 (00:14 +0000)
committerBen Pfaff <blp@ovn.org>
Thu, 11 Feb 2016 02:06:58 +0000 (18:06 -0800)
The keylen is not properly updated in the case of MPLS, directly causing the
hash to be calculated improperly.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
datapath-windows/ovsext/DpInternal.h
datapath-windows/ovsext/Flow.c

index 72e9b20..c094f32 100644 (file)
@@ -174,6 +174,7 @@ typedef __declspec(align(8)) struct OvsFlowKey {
 #define OVS_IPV6_KEY_SIZE (sizeof (Ipv6Key))
 #define OVS_ARP_KEY_SIZE (sizeof (ArpKey))
 #define OVS_ICMPV6_KEY_SIZE (sizeof (Icmp6Key))
+#define OVS_MPLS_KEY_SIZE (sizeof (MplsKey))
 
 typedef struct OvsFlowStats {
     Ovs64AlignedU64 packetCount;
index c22e8cf..5eec513 100644 (file)
@@ -1931,6 +1931,7 @@ OvsExtractFlow(const NET_BUFFER_LIST *packet,
         const MPLSHdr *mpls;
         MplsKey *mplsKey = &flow->mplsKey;
         ((UINT64 *)mplsKey)[0] = 0;
+        flow->l2.keyLen += OVS_MPLS_KEY_SIZE;
 
         /*
          * In the presence of an MPLS label stack the end of the L2