From nobody Thu Dec 09 18:59:02 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3937818C6EB3; Thu, 9 Dec 2021 18:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J93Gt4BxZz4TR1; Thu, 9 Dec 2021 18:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A7173E42; Thu, 9 Dec 2021 18:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B9Ix2kI046237; Thu, 9 Dec 2021 18:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B9Ix2YG046236; Thu, 9 Dec 2021 18:59:02 GMT (envelope-from git) Date: Thu, 9 Dec 2021 18:59:02 GMT Message-Id: <202112091859.1B9Ix2YG046236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fdf2f69042fa - stable/13 - ipfilter: Avoid more null if-then-else blocks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fdf2f69042fa915b44e5faad3c618b3eb27878f8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639076342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q2JQOni27Zm8/c8eNAHxGWYKL1gxeqyu461QQqgF+OA=; b=c1cpnszKtrJ7p5nk8bJ+Z24EiSG8g7uDRLHvnhYSUKW3xx9IYKtXokUXgsO9y9Xmx5ftWZ KzAbmbe+eyAD9q+ubS8wHuvnfvOanp5ewje74foU0cWVW9ses2JkTLlLjQhtyuI36ftvYU 12wg6sM8KEeV60K2XXEm1z/4+EromSj7Ae9tVlui5fiPqH4muhjLdklNAZcOP/TdHauJJ1 /zv7d2w5QwAj4fZeOBe+xR0zap34wjrN0Is9qUc/WiHzZ0Q0Ss9MUBKCNaA+V8RuHmMij0 Y575CmatHmRuxBE78TWvX+f/1Ie2ZgAMV+0Qelk2mtd2WYtXlOu3CthxBagmmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639076342; a=rsa-sha256; cv=none; b=hyHQPlp2GMnAGZf3B5KmF1BQL3Ml6jaRE7SFlNWl2jaSqc4zSt3Wa0G2iXA7xZr2PThYQr X5ZcKro+OzdmAgrTEhuQ/9xVJw3/5oIkBs4I3b83P4eZeNfbq5sRWnqxz8ALuer4Yi1mpH i2IREHaH/BbRyykN1Bmp8EMZnElT/II9IYl4xTN0c5pXrZMjEMrJTfQGj4RK7+2hLO4Bgb F1vkHVEV5ytUU1qIalEwGG6No3nKaKJcSd3vf5CMnjt1xIdIyGQr1q4+XABu5S8PYX3hNt mOsalQGlV3Nc1NLN2o50IXmgl4ZdvvjfNHvsm5GmchCbTStMxev2sP1+eoC6yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fdf2f69042fa915b44e5faad3c618b3eb27878f8 commit fdf2f69042fa915b44e5faad3c618b3eb27878f8 Author: Cy Schubert AuthorDate: 2021-10-20 03:11:40 +0000 Commit: Cy Schubert CommitDate: 2021-12-09 18:50:22 +0000 ipfilter: Avoid more null if-then-else blocks As in 73db3b64f167, when WITHOUT_INET6 is selected, null if-then-else blocks are generated because #if statements are incorrectly placed. Moving the #if statements reduces unnecessary runtime comparisons or compiler optimizations. (cherry picked from commit 130df64793d7d3c680c0f7177a707867a8a19665) --- sys/contrib/ipfilter/netinet/ip_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index b90ad09d8c00..af5ed81a5765 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -1367,8 +1367,8 @@ ipf_proxy_rule_rev(nat) if (ipn->in_v[0] == 4) { ipn->in_snip = ntohl(nat->nat_odstaddr); ipn->in_dnip = ntohl(nat->nat_osrcaddr); - } else { #ifdef USE_INET6 + } else { ipn->in_snip6 = nat->nat_odst6; ipn->in_dnip6 = nat->nat_osrc6; #endif @@ -1443,8 +1443,8 @@ ipf_proxy_rule_fwd(nat) if (ipn->in_v[0] == 4) { ipn->in_snip = ntohl(nat->nat_nsrcaddr); ipn->in_dnip = ntohl(nat->nat_ndstaddr); - } else { #ifdef USE_INET6 + } else { ipn->in_snip6 = nat->nat_nsrc6; ipn->in_dnip6 = nat->nat_ndst6; #endif