From nobody Wed Aug 07 13:44:41 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 4WfBHZ2kNwz5S9MB; Wed, 07 Aug 2024 13:44:42 +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 4WfBHZ0sqZz4jLP; Wed, 7 Aug 2024 13:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723038282; 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=rn8slkN2SKVqeC3HSg+M5ZIl3DcsPWCixE/dgA7DQ/I=; b=C/dc3GZChkgulWvQRjVFPIVhz3drmohHmnlXbg2Zxa8uWSWZzYSgzWjxcRek0uj1R2XeK8 veESA9E25ynam0gPgrHYa9MyctuR6PQJMhf/xMftSxatitMKyC630grLcOF/hy/jWBhW8r DkniDmleRk5KMP7yoSEgHC76Vk4JYa8ZENQBDjg7lU9OOkckm86gINu30J2Wi4ZoQqCjkI YpQvPx+/sLY2k0nwGk6N9cOb/Z+D9rYpIKit9RaJ9Axu2Se0ipeYjBi7/ErtgcGkOItWAN WbMvDnvaH/0iQ1AlpTfSfQOV1WDSefORHYRsVcj9l1EiZeCq//wQf8rN5GLrUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723038282; a=rsa-sha256; cv=none; b=Q8KEkwLV7DERUoaF8RPDGq/8It9EX5edZFLHkX29xhn+uj6QURGKwWQbr6QZEsQUfD3xcU GGJXnZdwt52IC1xvWwjisBqXMcjtjGrxOeHoBqgIePL4FD2ej0NYBbp8vFLfF9LSBdIVVI eYEo1tKesYcH6lZdR2t/Fb+0oYaLtpJ0JZ6Ghyvgqh1rYtLE6xiZDK3dzpJjv1iVZb750q hao8BNnKmQ4VGRzArWSOKVQHfUPr3rJ+vMwLQRDzaODy0INVe5LW/7dlhBtQJGDQOnJ/KH 8ap1FhqZZJryMoa5TA/oCGtJTpvaewXTP2htvr7sXP2v5kBWLzZ/gLDossSSCg== 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=1723038282; 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=rn8slkN2SKVqeC3HSg+M5ZIl3DcsPWCixE/dgA7DQ/I=; b=CZYTDyyiNeWnxnljW7Y/JjERd0wgvlSTzf0eq5gs5LIiBaA3kUdA9/nqFgZOzY2ebtb3mE LUuTbe74kGpU98/FpqGUkU2u09f1qfm3V4OJCXzB3Iyd9jmUZu3INmCXIWs8f0yKVG+3Vr wBIxRtQ+P1NJKC+SvuKNPm6PE1D6CiokHdT9ZiK/s/KVMUDUQPr1DSoSGIR+HGZcjDBPk3 pIyh3NWPXy1WtyotdmPDQiQtByA9AXOO6ajd9TMQGFOzh03/5M1J9xBmXWPr3Uad6MIVQH G3VaQUMOWaKexfF7hX1itrL+K9qQlTq7+Wkg0qASHVAYVD1eCPwTOrEaAeLECw== 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 4WfBHZ0Rf3zsV9; Wed, 7 Aug 2024 13:44:42 +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 477Difpv034107; Wed, 7 Aug 2024 13:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 477DifVo034104; Wed, 7 Aug 2024 13:44:41 GMT (envelope-from git) Date: Wed, 7 Aug 2024 13:44:41 GMT Message-Id: <202408071344.477DifVo034104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 01792dd7f27b - releng/14.0 - ifconfig: Fix default netmask calculation 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 01792dd7f27b3415e721f43f2d6e98df2346fd1f Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=01792dd7f27b3415e721f43f2d6e98df2346fd1f commit 01792dd7f27b3415e721f43f2d6e98df2346fd1f Author: Michael Gmelin AuthorDate: 2024-06-12 16:11:52 +0000 Commit: Mark Johnston CommitDate: 2024-08-07 13:31:10 +0000 ifconfig: Fix default netmask calculation Approved by: so Security: FreeBSD-EN-24:14.ifconfig Reported by: phk Reviewed by: emaste, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45570 (cherry picked from commit 8a9f0fa42b1c6cffd45459bb552e138083b00369) (cherry picked from commit 048ad7a9ef9fe15368ff287db5c705c8163f4e1c) --- sbin/ifconfig/af_inet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index 83b605e8c4cb..8032c7035c95 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -445,7 +445,7 @@ in_exec_nl(if_ctx *ctx, unsigned long action, void *data) static void in_setdefaultmask_nl(void) { - struct in_px *px = sintab_nl[ADDR]; + struct in_px *px = sintab_nl[ADDR]; in_addr_t i = ntohl(px->addr.s_addr); @@ -456,11 +456,11 @@ in_setdefaultmask_nl(void) * we should return an error rather than warning. */ if (IN_CLASSA(i)) - px->plen = IN_CLASSA_NSHIFT; + px->plen = 32 - IN_CLASSA_NSHIFT; else if (IN_CLASSB(i)) - px->plen = IN_CLASSB_NSHIFT; + px->plen = 32 - IN_CLASSB_NSHIFT; else - px->plen = IN_CLASSC_NSHIFT; + px->plen = 32 - IN_CLASSC_NSHIFT; px->maskset = true; } #endif