From nobody Tue Jun 23 21:04:22 2026 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 4glHcl4pHNz6j7Ww for ; Tue, 23 Jun 2026 21:04:23 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4glHcl0wp1z3LM6 for ; Tue, 23 Jun 2026 21:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782248663; 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=hRo8C5iLn/C3R8RpZy5OzhfHgs0RsUC0ipxAz4ugbe4=; b=pxM4wGnTzFfIR/CldLJEp1IuD2aK5cogkdjuo5/hUFDxWTUFW3EZC7OPb/CLMJs1sx16PF 3055tTXwaFs99yXVp+qPDkFCMlzQm2zX+5RTIJeEM+5A3QZx+CcCT0/PtJ8JWZCauUwDbM W0/coK1C3jzPLGWszo7ECqEWKBfGI7hPaDSV+fqbHmhnOvXShCKR5XzLG5nrbthNUsjMJV KgJHIiRurlRJbGhfbQOafBc5pRqckKKiFv+OH4dwESsmrZ6RS0uUUWUk5NRo0WHjDhNYcx iughZPI/gLvJ+aF7FJWc1AiAVbjDIQ4wD5242YQkB/eQFCrle2sOGqnAlSVZCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782248663; a=rsa-sha256; cv=none; b=pJDyRhZRIUsEZQEQWMOg7LAyd+frS+rGLQUiS0CB7W1nfj7SwryBZdmHuYfwew0B96wBBB FCiKfAAC2LQpO2VrmzfyTLjO86sfhYeNWpfHoI+OWjGeIbUkHB4zf+ugeLXjPqPGwOWRaN snAVUZALkIhpgqWJ0NrGbVhYcYLoWT0c27IBAYhTgGKoY5plGnf9vT6Hh3J+83gCFOhHnY fFjx9NUxXALD7SaXbQCqTJWRnfpCIb98R09AglBUPmaXcdw5YkL4a0/tgRlsVvggX7V8ww ibmVjtEhra6seOwD92Dyr97e9rjm86+7WWDfq4RO/fZGqK/em/Oj9McoOMQbXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782248663; 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=hRo8C5iLn/C3R8RpZy5OzhfHgs0RsUC0ipxAz4ugbe4=; b=bxG4L+DDLCCaZ+SfpQsBlTgFl7FdTpm5x/uPCy2/REQHbQBIUsted4eOTSx3PY+wHVHkJ6 QmrWzg5DPnFvktgLhwwt+E5POXUTg2GRaSFFEMLMoH4+6gGF966HOjWGMvE3dv8NnuHXnj 8GhSBaEjvoIh1knzZyZyi924fV472GqRdqNGW6E0h4X9/q7k78zUc7TBlcnRjqVzAYtcGQ Pm8KSZGnFo07AoKQIKeHviqURECI1HBJn7HMrhJuAXkfyjVU1uy+4wnvIEgQw/A/kGXUbT bnmZ/DrdmWtRMHTgVcZDPxqLcULHwC1/YyWcaerPrKTYAa2U92ocCRLUVWwxMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4glHck6wJ8zrF2 for ; Tue, 23 Jun 2026 21:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d491 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 23 Jun 2026 21:04:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 7e093e5780bb - main - ifconfig: Fix handling of unsupported -j option with MK_JAIL=no 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e093e5780bbf5af416526c1ab6339fe6e94b37b Auto-Submitted: auto-generated Date: Tue, 23 Jun 2026 21:04:22 +0000 Message-Id: <6a3af4d6.1d491.44668355@gitrepo.freebsd.org> The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=7e093e5780bbf5af416526c1ab6339fe6e94b37b commit 7e093e5780bbf5af416526c1ab6339fe6e94b37b Author: Hiroki Sato AuthorDate: 2026-06-23 21:02:47 +0000 Commit: Hiroki Sato CommitDate: 2026-06-23 21:02:47 +0000 ifconfig: Fix handling of unsupported -j option with MK_JAIL=no The ifconfig(8) utility built with MK_JAIL=no does not support the -j option. When the option is specified, Perror() is called without setting errno, which can result in errno being reported as zero and a misleading error message being displayed. Also remove "[-j jail]" from the usage message when built with MK_JAIL=no. Event: Halifax Hackathon 202606 --- sbin/ifconfig/ifconfig.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 9aeb4a09ef49..0e839eeafc5b 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -168,15 +168,21 @@ usage(void) strlcat(options, " ", sizeof(options)); } +#ifdef JAIL +#define JFLAG " [-j jail] " +#else +#define JFLAG " " +#endif fprintf(stderr, - "usage: ifconfig [-j jail] [-f type:format] %sinterface address_family\n" + "usage: ifconfig" JFLAG "[-f type:format] %sinterface address_family\n" " [address [dest_address]] [parameters]\n" - " ifconfig [-j jail] interface create\n" - " ifconfig [-j jail] -a %s[-d] [-m] [-u] [-v] [address_family]\n" - " ifconfig [-j jail] -l [-d] [-u] [address_family]\n" - " ifconfig [-j jail] %s[-d] [-m] [-u] [-v]\n", + " ifconfig" JFLAG "interface create\n" + " ifconfig" JFLAG "-a %s[-d] [-m] [-u] [-v] [address_family]\n" + " ifconfig" JFLAG "-l [-d] [-u] [address_family]\n" + " ifconfig" JFLAG "%s[-d] [-m] [-u] [-v]\n", options, options, options); exit(1); +#undef JFLAG } static void @@ -503,7 +509,7 @@ args_parse(struct ifconfig_args *args, int argc, char *argv[]) if (jail_attach(jid) != 0) Perror("cannot attach to jail"); #else - Perror("not built with jail support"); + Perrorc("not built with jail support", EINVAL); #endif break; case 'k':