From nobody Mon Dec 30 20:44:51 2024 X-Original-To: dev-commits-src-all@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 4YMSlS2GkTz5j0V6; Mon, 30 Dec 2024 20:44:52 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YMSlS0McSz4J4J; Mon, 30 Dec 2024 20:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735591492; 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=LXZ5QD9sTK9rYoIUccl0PWxMmxdEOJnIv+IKDYYmuUg=; b=kblfZaGCDW9wIa3q0VymboS2DEwUOB8uRZkLqWwNcwueOnh5BX9JSsFovSgJVa3cq9nCJq da8CcJFV/BPscCw6G0M2zX1GOv1ohzYqgZ6/s0wC+G99RMQjDZY+U1oJW7ZiCVqWnmOni3 aDBYklvRh8MWN6LvzhPg9n55LdkUEAYCNSoA/bUNYoHxZ0DHDvZG7xC6Mx91Ocin/xTRTn obb07hGMW+cDAFAHuaIzwvjXL3kR/yjpGUTq9I6mVgkhkyZlLqabKuPq9lgtz5jSjw5eZZ X7UgRD8BHckY/PtqoChFpJHA0EfW2asfrqhXwMHXZuWskt3ftOQgQsuNm+79JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735591492; 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=LXZ5QD9sTK9rYoIUccl0PWxMmxdEOJnIv+IKDYYmuUg=; b=uV2bBNs0aQ9Ou43S7u+TMStrltvA1dtWgnnZJSlHlf7UbtbC6wWT91k4vUWACwOLLZgCEr XkqWVYydlD/tWDbaN9KRAJLHSLuc9xeQlr6GiB2gn+hK04kiTXPRf1tyc2kBf8DjfR7ScH iqCwUdJLIIngdJqFll0Ka34gjx2kvMgRicZltq8Ff0pNiRZvTNq6FuM+dxEBw7f7zkjLsi tuTp9jjfKCuwnUMIy4tsqLsEAAsKx0Mm75VL96prGdheBpMN/frnZJsGL4ykXC3SDL2r5X DtQQQjAhB/Zb4X7oCQfZnrygTkAupfs1jHxFUl6KHMCxhVEfQC5iWCLNrKhYCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735591492; a=rsa-sha256; cv=none; b=Ggaa++e3/ly4vnSIIBSb1LWt+lpczf/cnkvJ0istOjWBUr6DTJHtfGbHpgDOWB1NsdQTwM 4mz5wjUzFNgMkTGfeHmUQqSz7RnsQykbly7D06qhbmo15O9MxwAqRpH2WyrYOWvwkDMd6A OA2cG1QGbjCml+D0cY0dnORobYrsLumOsWT/FGR6ZGT0+Q+bBeDyzeoKFCOU67ZYQGT16X H7wjgawfMbZebmQLOdjwOku4fnGFnnCPQR4b1tYRZuB2+676yW9XvESHwItZHi+ROiynQi sLk1HqXUBeaX5Cdf3ym8v1Ga2JiB8aEVLsduzCeGG/Kk/NesGMCVSn5Qdv/tfw== 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 4YMSlR74lyz18hG; Mon, 30 Dec 2024 20:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BUKip2j020047; Mon, 30 Dec 2024 20:44:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BUKippC020044; Mon, 30 Dec 2024 20:44:51 GMT (envelope-from git) Date: Mon, 30 Dec 2024 20:44:51 GMT Message-Id: <202412302044.4BUKippC020044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ec30ca2e13ae - main - pf: remove impossible condition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec30ca2e13aec6c1778a008f2ca404bca8d7575f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec30ca2e13aec6c1778a008f2ca404bca8d7575f commit ec30ca2e13aec6c1778a008f2ca404bca8d7575f Author: Kristof Provost AuthorDate: 2024-12-28 16:00:39 +0000 Commit: Kristof Provost CommitDate: 2024-12-30 20:42:12 +0000 pf: remove impossible condition There's no need to account for pd->af == pd->naf in this section of pf_state_key_setup() because we only get here if pd->af != pd->naf (i.e. nat64). Pointed out by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 695ecfc0269d..cd557a9614d1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1706,12 +1706,10 @@ pf_state_key_setup(struct pf_pdesc *pd, u_int16_t sport, u_int16_t dport, bzero(&(*nk)->addr[0], sizeof((*nk)->addr[0])); bzero(&(*nk)->addr[1], sizeof((*nk)->addr[1])); - PF_ACPY(&(*nk)->addr[pd->af == pd->naf ? pd->sidx : pd->didx], - &pd->nsaddr, pd->naf); - PF_ACPY(&(*nk)->addr[pd->af == pd->naf ? pd->didx : pd->sidx], - &pd->ndaddr, pd->naf); - (*nk)->port[pd->af == pd->naf ? pd->sidx : pd->didx] = pd->nsport; - (*nk)->port[pd->af == pd->naf ? pd->didx : pd->sidx] = pd->ndport; + PF_ACPY(&(*nk)->addr[pd->didx], &pd->nsaddr, pd->naf); + PF_ACPY(&(*nk)->addr[pd->sidx], &pd->ndaddr, pd->naf); + (*nk)->port[pd->didx] = pd->nsport; + (*nk)->port[pd->sidx] = pd->ndport; switch (pd->proto) { case IPPROTO_ICMP: (*nk)->proto = IPPROTO_ICMPV6;