From patchwork Fri Feb 7 22:55:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi-Hung Wei X-Patchwork-Id: 1235156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NBQMGZFb; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48DrbX5nwhz9sRQ for ; Sat, 8 Feb 2020 10:09:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EF9C888075; Fri, 7 Feb 2020 23:09:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MUEDVc9uTr+b; Fri, 7 Feb 2020 23:09:25 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 0576187EA6; Fri, 7 Feb 2020 23:09:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E7C44C1796; Fri, 7 Feb 2020 23:09:24 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id EEB85C013E for ; Fri, 7 Feb 2020 23:09:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EADD686661 for ; Fri, 7 Feb 2020 23:09:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hQYhJeeKpLq5 for ; Fri, 7 Feb 2020 23:09:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 66BBC8648E for ; Fri, 7 Feb 2020 23:09:22 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id e8so339651plt.9 for ; Fri, 07 Feb 2020 15:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=NjP952DSWMKt9p6QHKs8HaKEfvAfmcvJfEQp55js1sY=; b=NBQMGZFbMApyZn9UJBABN8wvBPwtBUP7PDrmVWTrccFdoUqQZ+4Z+2/5SnTk4PXhkM uehORODi2z6mRk/5NcQUiDmb4ZrJap+YrHHgZp4GZLSbp0CuxuAWhhXPk/ewzSQFNlPj LnN57c8ZVtpwH3gkEWp/AAF9B+xiepLkuKxQNxGi7pFXWtnZ4lzQjmIV5upmrDatV6nk qUZNwqnea/Xa4Udyhd//VEcPy19xkPNNr4kaYfNQNZ2PKE9/OliLNt8HWa6eeoXhbyN+ acFOhrc5eePaA8zXC6Ag8acq1gjUFvtPcEsuS5SCp+eMshaZLo1sSHPzd8m535ytyVuE 51IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NjP952DSWMKt9p6QHKs8HaKEfvAfmcvJfEQp55js1sY=; b=bAvukFLnxMErR2SrEnvcad7hCHo8rSgppAx0VJTzdT63zbhpFLhgld129Z4du58zkH PD6fgETo3PhpJrpScLO7YvnEavnhGNvJQQ3Tu7grcpkrQxi1OH9ZJebdMbykMP0frTdk z2WAkgU6/CjiyRWQ/hhunS4YumvBPQCZkD9BWMqU4caCGl2bwUuQ0QN2I56qsCVS9A+R 1DC47c6k/Esz5ObXD2faVbEoktlL2lFK/XXlMuBwRtgSQCZHZ3gMbqctfH+2sgMsm1Aj pKeCpneCN/nzlQGeVmRn8PWoIvRxT0pYC+Qq4xr23M0iTwoYBM53naaih5NBZApw8p6s rhCQ== X-Gm-Message-State: APjAAAWzH6nmjWSYCwyB9ud2Nm7bGtaj/tmitx0PYEsXwVp6ObxHLQXE YzVtNDMua9hggwTde+Hbs1E/Eu/Z X-Google-Smtp-Source: APXvYqwa5LmsxAoVrbRKKM7Jy+8pLTjQcx+5Ak8byX863aT4PWtoBVGoVb0RdZK0r2ed1zvF5XgXTw== X-Received: by 2002:a17:90a:3a86:: with SMTP id b6mr6462127pjc.96.1581116961457; Fri, 07 Feb 2020 15:09:21 -0800 (PST) Received: from Husky.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id a17sm4181498pfo.146.2020.02.07.15.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Feb 2020 15:09:19 -0800 (PST) From: Yi-Hung Wei To: dev@openvswitch.org, dceara@redhat.com Date: Fri, 7 Feb 2020 14:55:06 -0800 Message-Id: <1581116106-24519-1-git-send-email-yihung.wei@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] conntrack: Fix TCP conntrack state X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" If a TCP connection is in SYN_SENT state, receiving another SYN packet would just renew the timeout of that conntrack entry rather than create a new one. Thus, tcp_conn_update() should return CT_UPDATE_VALID_NEW. This also fixes regressions of a couple of OVN system tests. Fixes: a867c010ee91 ("conntrack: Fix conntrack new state") Reported-by: Dumitru Ceara Signed-off-by: Yi-Hung Wei Tested-by: Dumitru Ceara --- Please backport to branch 2.13. --- lib/conntrack-tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/conntrack-tcp.c b/lib/conntrack-tcp.c index 416cb769d22f..47261c7551d1 100644 --- a/lib/conntrack-tcp.c +++ b/lib/conntrack-tcp.c @@ -189,7 +189,7 @@ tcp_conn_update(struct conntrack *ct, struct conn *conn_, } else if (src->state <= CT_DPIF_TCPS_SYN_SENT) { src->state = CT_DPIF_TCPS_SYN_SENT; conn_update_expiration(ct, &conn->up, CT_TM_TCP_FIRST_PACKET, now); - return CT_UPDATE_NEW; + return CT_UPDATE_VALID_NEW; } }