From patchwork Tue Feb 26 00:37:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1048047 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="IB/w9X2t"; 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 447g853v2Nz9s2R for ; Tue, 26 Feb 2019 11:45:08 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A8F066E31; Tue, 26 Feb 2019 00:45:05 +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 3BB816D97 for ; Tue, 26 Feb 2019 00:38:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CC65912E for ; Tue, 26 Feb 2019 00:38:02 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id i130so5316058pgd.1 for ; Mon, 25 Feb 2019 16:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=ccVUKLa8b7wODmG/8f3fI4CnFIEWAv/cugV/eA76yb8=; b=IB/w9X2tndVgBV1ANKLFDKGiNKMfpU0jlPKWOeQSnEa+9NzQ6IQ5HrP0+3ioQG7f6y IFr6n5e6E8jqP+0Uzvg+5+hAuhz2/dFh3X45L7QCIi4PWYmUsA0iyVTfyypwEYo4PH+O QgmPsQF3XzsjUujub48FhOI4HacxgkGV3wTBYY5y62V4+BwaPlz2P9Kg+wAZ4fPI1cyb Fmeg0gSuzoqbAa31aYvQuTYP+8cfnYAw9WALTEaHROuoFT6Ia84x43l317G13Hym2Sam t7NIzvAhkglAcmr4VNtg4N2neUtkOseGecCl6KmMSjuJmd2wvjOasuTlxSpiIhpYD893 hJkg== 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; bh=ccVUKLa8b7wODmG/8f3fI4CnFIEWAv/cugV/eA76yb8=; b=VOPalzpHSrf4/5ZUXH1yKBT2eLWmhNRrYzLiXDOTBPyuI7PlsZ7afsMuUKBuy6W/AW QHBIKfOs+SsWOayOEbhwVwlTCwf8c5f09jrTb9JYJaofbnONHKeOwqPjGLQznTN+h02L Mqg9sxo5Rb2m+Mz9PaZrqamKZw5HxJyaH9vRTRfrph1DZMkdr9lpCIy8BdK0IPZ/otLQ jMQn4n6s20SMOiKeQXoDZ0B5menkILG537CZfYAgybodXP/dsGYc3ebHqMuG5DY7/kWw P5F4+ojQt6gGigcd7ZLLp2Tp/5TSX7Tx6cZIJq0AWbfWyNAUTdg4QtpY+ooCJEpxpcqA 4+fg== X-Gm-Message-State: AHQUAuYzbWDw8ekdayHLovwk5gc6w+YPEH/TkpgXaYY4V+tzFA6+zOlZ /s0b1GwwCiQICQZYEUlIPjw= X-Google-Smtp-Source: AHgI3IZAa2fVPRHFmJ/nENYhdY3R1eXqwk3bb1Fa16nEQlAwJVawXgl6sQxDAax3tsOaJxKxcbPcaw== X-Received: by 2002:a63:f07:: with SMTP id e7mr21892120pgl.173.1551141482441; Mon, 25 Feb 2019 16:38:02 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id a2sm4846977pff.58.2019.02.25.16.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 16:38:01 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Mon, 25 Feb 2019 16:37:50 -0800 Message-Id: <1551141470-85668-1-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 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 v1] conntrack: Consolidate 2 selection statements. 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 No functional change. Signed-off-by: Darrell Ball --- lib/conntrack.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 7ead3ad..691782c 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -2187,12 +2187,9 @@ nat_select_range_tuple(struct conntrack *ct, const struct conn *conn, while (true) { if (conn->nat_info->nat_action & NAT_ACTION_SRC) { nat_conn->rev_key.dst.addr = ct_addr; - } else { - nat_conn->rev_key.src.addr = ct_addr; - } - if (conn->nat_info->nat_action & NAT_ACTION_SRC) { nat_conn->rev_key.dst.port = htons(port); } else { + nat_conn->rev_key.src.addr = ct_addr; nat_conn->rev_key.src.port = htons(port); }