summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Conntrack.c
diff options
context:
space:
mode:
authorAnand Kumar <kumaranand@vmware.com>2017-06-23 14:05:12 -0700
committerGurucharan Shetty <guru@ovn.org>2017-06-27 13:12:21 -0700
commitde8f7050d558cdab421bfa566caacd5f15ceaba0 (patch)
tree15c607d25e6fb4aa7d01e230827cc0551f914f63 /datapath-windows/ovsext/Conntrack.c
parent5119e258da9219c06a0f6b52aaf3bb619241d4d7 (diff)
downloadopenvswitch-de8f7050d558cdab421bfa566caacd5f15ceaba0.tar.gz
datapath-windows: Include ICMP type and code fields to find a matching ct entry
In conntrack lookup, ICMP type and code fields were not being used to determine a matching entry. As a result, ICMP4_ECHO_REQUEST packet could be tracked as ICMP4_ECHO_REPLY packet and vice versa, which is invalid. To fix this, add ICMP type and code fields for matching a conntrack entry. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Conntrack.c')
-rw-r--r--datapath-windows/ovsext/Conntrack.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
index e0fb7b454..8ea1e6590 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -373,15 +373,13 @@ OvsDetectCtPacket(OvsForwardingContext *fwdCtx,
BOOLEAN
OvsCtKeyAreSame(OVS_CT_KEY ctxKey, OVS_CT_KEY entryKey)
{
- return ((ctxKey.src.addr.ipv4 == entryKey.src.addr.ipv4) &&
- (ctxKey.src.addr.ipv4_aligned == entryKey.src.addr.ipv4_aligned) &&
- (ctxKey.src.port == entryKey.src.port) &&
- (ctxKey.dst.addr.ipv4 == entryKey.dst.addr.ipv4) &&
- (ctxKey.dst.addr.ipv4_aligned == entryKey.dst.addr.ipv4_aligned) &&
- (ctxKey.dst.port == entryKey.dst.port) &&
- (ctxKey.dl_type == entryKey.dl_type) &&
- (ctxKey.nw_proto == entryKey.nw_proto) &&
- (ctxKey.zone == entryKey.zone));
+ return ((NdisEqualMemory(&ctxKey.src, &entryKey.src,
+ sizeof(struct ct_endpoint))) &&
+ (NdisEqualMemory(&ctxKey.dst, &entryKey.dst,
+ sizeof(struct ct_endpoint))) &&
+ (ctxKey.dl_type == entryKey.dl_type) &&
+ (ctxKey.nw_proto == entryKey.nw_proto) &&
+ (ctxKey.zone == entryKey.zone));
}
static __inline VOID