From nobody Fri Jan 13 19:39:56 2023 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 4NtsFV1bn7z2p2ky; Fri, 13 Jan 2023 19:39:58 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4NtsFT6Dppz3mGL; Fri, 13 Jan 2023 19:39:57 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id 415054C7E; Fri, 13 Jan 2023 11:39:56 -0800 (PST) Date: Fri, 13 Jan 2023 11:39:56 -0800 From: Gleb Smirnoff To: Zhenlei Huang Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8bce8d28abe6 - main - jail: Avoid multipurpose return value of function prison_ip_restrict() Message-ID: References: <202301131046.30DAkA0F024400@gitrepo.freebsd.org> 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202301131046.30DAkA0F024400@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4NtsFT6Dppz3mGL X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Zhenlei, a couple concise assignments missed: Z> @@ -1876,15 +1871,15 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) Z> continue; Z> } Z> #endif Z> - if (prison_ip_restrict(tpr, PR_INET, NULL)) { Z> - redo_ip4 = 1; Z> + if (!prison_ip_restrict(tpr, PR_INET, NULL)) { Z> + redo_ip4 = true; Z> descend = 0; Z> } Z> } Z> } redo_ip4 = !prison_ip_restrict(tpr, PR_INET, NULL); Z> @@ -1896,8 +1891,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) Z> continue; Z> } Z> #endif Z> - if (prison_ip_restrict(tpr, PR_INET6, NULL)) { Z> - redo_ip6 = 1; Z> + if (!prison_ip_restrict(tpr, PR_INET6, NULL)) { Z> + redo_ip6 = true; Z> descend = 0; Z> } Z> } redo_ip6 = !prison_ip_restrict(tpr, PR_INET6, NULL); -- Gleb Smirnoff