From patchwork Wed Sep 5 05:14:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 966218 X-Patchwork-Delegate: jpettit@nicira.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.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.b="OTMAubTx"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 424sP53Czqz9s3Z for ; Wed, 5 Sep 2018 15:16:09 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 35528CA4; Wed, 5 Sep 2018 05:15:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A29CDC9F for ; Wed, 5 Sep 2018 05:15:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5E9268B for ; Wed, 5 Sep 2018 05:15:07 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id l63-v6so2798555pga.7 for ; Tue, 04 Sep 2018 22:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=ADRa4UnyJQIWtt0sWP4mSQCgWrL/FBCXJ76/cJg0+KQ=; b=OTMAubTx3cwiOfws6KT99lyiLdFmOePdMiOZa3q5MxQVRdWevqQJOVXZ7p4pEDrcEy JSbf5S72B5uW9/dPDEKQsXw32evjHMQQGYReVfba+apUA0iRRtCalB5v44V2660nh1cI zX8P9CVcZgRsrXAh9rua9tlxNo0IXOPNjdyOxCQIHdN/PlbMLgYa5MYTccpJf1GgHv6z bCe0TXrD0QfjEyDM/5ddq74HrZwb4CpAAKyd961U9kBhsh/3O65DD38sqaoVPqdevEFS kP4VikPuRrbnK0WQtz6xaA+1aBSeQ924GIg755c2rh6uxR1f3fg8pM4zh0+J+5CKmpVF M6Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ADRa4UnyJQIWtt0sWP4mSQCgWrL/FBCXJ76/cJg0+KQ=; b=ax7lvuIAZ3o7fsyLwZKiNO9JmRDYSmtk80J574r5kiAhiT013Gf2+G8vesDMuvUX5Z V5CdW8buZlKCFSI4Ceu7TM6YnL6heuYP7MtgmF9FimohgR2vgc+zZEY7muPPQo6OF2/6 171q9sJB8r76q8oi4T+V+/LaugMpz8+qYDzRnQhwSb/7VK0a3i6MCFQ+V35FWgZ4dWXQ jToMYDe307d2Lqjaz7lZgDI9rEh8XUWqYVeCtu0+I+gVQ7rK1Xx5IpzfEqI8XCsmG0gv Qw4tYCPt6WY8UNXItkyvs5PI52/le+SJI0lX7u17qcuQ5I0fany2HRaIi/AIpX94KUUY G/8A== X-Gm-Message-State: APzg51DYoEyVSSC2LuvmX5aKMPQZn7Cy1Cyned8QSGc02i5oox1iW4cP ZJV/PlqRaS+Dy4IPq4v3wSL/Qnln X-Google-Smtp-Source: ANB0VdZLLcxJ/m8xShpllKTWDEammNaOyEOJGC2FlzNj75o94WZxS4P5vAv1pKA/2iRNNVX1UOK3kA== X-Received: by 2002:a63:5756:: with SMTP id h22-v6mr23015918pgm.423.1536124507059; Tue, 04 Sep 2018 22:15:07 -0700 (PDT) Received: from ubuntu.localdomain (8.sub-174-214-5.myvzw.com. [174.214.5.8]) by smtp.gmail.com with ESMTPSA id 3-v6sm1298999pfq.10.2018.09.04.22.15.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 22:15:06 -0700 (PDT) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 4 Sep 2018 22:14:47 -0700 Message-Id: <1536124490-86810-3-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536124490-86810-1-git-send-email-dlu998@gmail.com> References: <1536124490-86810-1-git-send-email-dlu998@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [patch v2 3/6] conntrack: Enforce conn_type for conn_clean(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Add check to validate that 'conn_clean()' is only called for conntrack entries of default 'conn_type'. Needs backporting to 2.8. Signed-off-by: Darrell Ball --- lib/conntrack.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/conntrack.c b/lib/conntrack.c index 4b53e82..15e0a62 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -806,11 +806,14 @@ nat_clean(struct conntrack *ct, struct conn *conn, ct_lock_lock(&ctb->lock); } +/* Must be called with 'conn' of 'conn_type' CT_CONN_TYPE_DEFAULT. */ static void conn_clean(struct conntrack *ct, struct conn *conn, struct conntrack_bucket *ctb) OVS_REQUIRES(ctb->lock) { + ovs_assert(conn->conn_type == CT_CONN_TYPE_DEFAULT); + if (conn->alg) { expectation_clean(ct, &conn->key, ct->hash_basis); }