summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Britstein <elibr@nvidia.com>2022-07-17 17:42:11 +0300
committerIlya Maximets <i.maximets@ovn.org>2022-07-25 18:42:54 +0200
commit1c93677c903d6fd50762c568e80e537ed05edae2 (patch)
tree03b54d98c90e45406800941f8b64d20986d7a688
parent7b1cb1b460dddf9d7a46afce3764af41351f6849 (diff)
downloadopenvswitch-1c93677c903d6fd50762c568e80e537ed05edae2.tar.gz
conntrack: Fix conntrack multiple new state.
A connection is established if we see packets from both directions. The cited commit fixed the issue of sending twice in one direction, but still an issue if more than that. Fix it. Fixes: a867c010ee91 ("conntrack: Fix conntrack new state") Signed-off-by: Eli Britstein <elibr@nvidia.com> Acked-by: Paolo Valerio <pvalerio@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--lib/conntrack-other.c7
-rw-r--r--tests/system-traffic.at9
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/conntrack-other.c b/lib/conntrack-other.c
index d3b460185..7f3e63c38 100644
--- a/lib/conntrack-other.c
+++ b/lib/conntrack-other.c
@@ -48,18 +48,19 @@ other_conn_update(struct conntrack *ct, struct conn *conn_,
struct dp_packet *pkt OVS_UNUSED, bool reply, long long now)
{
struct conn_other *conn = conn_other_cast(conn_);
- enum ct_update_res ret = CT_UPDATE_VALID;
if (reply && conn->state != OTHERS_BIDIR) {
conn->state = OTHERS_BIDIR;
} else if (conn->state == OTHERS_FIRST) {
conn->state = OTHERS_MULTIPLE;
- ret = CT_UPDATE_VALID_NEW;
}
conn_update_expiration(ct, &conn->up, other_timeouts[conn->state], now);
- return ret;
+ if (conn->state == OTHERS_BIDIR) {
+ return CT_UPDATE_VALID;
+ }
+ return CT_UPDATE_VALID_NEW;
}
static bool
diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index 1a1a69d2d..ee8015546 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -2561,6 +2561,15 @@ NXST_FLOW reply:
table=1, priority=100,ct_state=+est+trk,in_port=1 actions=output:2
])
+dnl Send a 3rd UDP packet on port 1
+AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"])
+
+dnl There still should not be any packet that matches the established ct_state.
+AT_CHECK([ovs-ofctl dump-flows br0 "table=1 in_port=1,ct_state=+trk+est" | ofctl_strip], [0], [dnl
+NXST_FLOW reply:
+ table=1, priority=100,ct_state=+est+trk,in_port=1 actions=output:2
+])
+
OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP