From nobody Sun Jul 24 15:31:58 2022 X-Original-To: freebsd-jail@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 4LrRxM2F4Tz4Wqh4 for ; Sun, 24 Jul 2022 15:32:07 +0000 (UTC) (envelope-from pi@freebsd.org) Received: from fc.opsec.eu (fc.opsec.eu [IPv6:2001:14f8:200:4::4]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4LrRxL3SmCz46DB for ; Sun, 24 Jul 2022 15:32:06 +0000 (UTC) (envelope-from pi@freebsd.org) Received: from pi by fc.opsec.eu with local (Exim 4.95 (FreeBSD)) (envelope-from ) id 1oFdaI-000JfC-D2; Sun, 24 Jul 2022 17:31:58 +0200 Date: Sun, 24 Jul 2022 17:31:58 +0200 From: Kurt Jaeger To: James Gritton Cc: freebsd-jail@freebsd.org Subject: Re: jail created with ip4=new and ipv4.addr shows ip4=disable on jail -s Message-ID: References: <8e1bf678efc18f9d3c4d5ee16df3caa1@gritton.org> List-Id: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8e1bf678efc18f9d3c4d5ee16df3caa1@gritton.org> X-Rspamd-Queue-Id: 4LrRxL3SmCz46DB X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 2001:14f8:200:4::4 is neither permitted nor denied by domain of pi@freebsd.org) smtp.mailfrom=pi@freebsd.org X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-jail@freebsd.org]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[pi]; ASN(0.00)[asn:12502, ipnet:2001:14f8::/32, country:DE]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Hi! > > On a 13.1 box: > > > > The jail is created with: > > > > /usr/sbin/jail -c allow.raw_sockets allow.sysvipc devfs_ruleset=4 > > host.hostname=somehostname path=/somepath ip4=new ip4.addr= > > ip6=new ip6.addr= command=/bin/sh /etc/rc > > But: > > jail -s > > displays: > > [...] ip4=disable ip6=disable > > Is that a bug and if not, why does it behave like that ? > > It's a bug in the reporting. Thanks very much for the explaination! > ip4 is presented as a jailsys parameter with > its values of disable, inherit, and new. jail_get(2) reports such values > based on flags in the prison structure, but ip4 and ip6 are only stored as > a single bit with disable indistinguishable from new. jail_get should be > looking at the number of IP addresses, which is what tells the difference. Interesting! -- pi@FreeBSD.org +49 171 3101372 Now what ?