summaryrefslogtreecommitdiff
path: root/lib/conntrack-icmp.c
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2020-04-27 08:42:29 -0700
committerWilliam Tu <u9012063@gmail.com>2020-04-29 08:59:51 -0700
commitd93c3111ccbf738c4b463d5c0892e981851d55ad (patch)
tree14da45582f1f2fa25d1c535f79a6f05c50a7f29a /lib/conntrack-icmp.c
parent8c2b63b7804eb348550f63d97801cc9a002a94c3 (diff)
downloadopenvswitch-d93c3111ccbf738c4b463d5c0892e981851d55ad.tar.gz
conntrack: Fix icmp conntrack state.
ICMP conntrack state should be ICMPS_REPLY after seeing both side of ICMP traffic. Signed-off-by: William Tu <u9012063@gmail.com> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Diffstat (limited to 'lib/conntrack-icmp.c')
-rw-r--r--lib/conntrack-icmp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/conntrack-icmp.c b/lib/conntrack-icmp.c
index 63246f012..6cbf9656d 100644
--- a/lib/conntrack-icmp.c
+++ b/lib/conntrack-icmp.c
@@ -50,9 +50,12 @@ icmp_conn_update(struct conntrack *ct, struct conn *conn_,
struct dp_packet *pkt OVS_UNUSED, bool reply, long long now)
{
struct conn_icmp *conn = conn_icmp_cast(conn_);
- conn->state = reply ? ICMPS_REPLY : ICMPS_FIRST;
- conn_update_expiration(ct, &conn->up, icmp_timeouts[conn->state], now);
+ if (reply && conn->state == ICMPS_FIRST) {
+ conn->state = ICMPS_REPLY;
+ }
+
+ conn_update_expiration(ct, &conn->up, icmp_timeouts[conn->state], now);
return CT_UPDATE_VALID;
}