From nobody Wed Aug 07 13:44:28 2024 X-Original-To: dev-commits-src-branches@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 4WfBHJ3HM3z5S9L4; Wed, 07 Aug 2024 13:44:28 +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 4WfBHJ1bH6z4hyv; Wed, 7 Aug 2024 13:44:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723038268; 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=rb+M5nWNd3cr3MVEa2z6uLURyPWk4yMVVaXqdwnQ2Yg=; b=KkzmTNnSGhcRhJ0irC7ef6FMTZKipfeictUMTMfXkrvhA68HHHjAxd/bFRMO4QQkOcNvWJ +WYrkOHZI4kI14nZokHG5ovqXN/exp3FOH8kPxytTktPgXU2qgdRs4O/HnxH8DXw+7GCDB TmXX9aHJYvaBVAqnX93RGBlR9xgltK0m5JyS0MuiARV9uchcdLfm7RBcYM2Ht/qiOhO9i4 Aksfizo3SvrZA89X0RU9rmYEnPx9l1plqZnIYfqhdMP6HoVGDem+clZmijXC7vkwbZjN/S BHszF+RijcOZ0nY3wt8rd02SB04jQPndOzCCOYIvQzZn9OG82I6tU6CKjRkZyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723038268; a=rsa-sha256; cv=none; b=oTyFBumbldCvyo29p0cdqKulzWLyu+DYW3XFmcJ0be6qSj+symSnlVskdUnY+8HDvasDpN PRzu1zu8o8GBvahjUwnf83ccv0kLpyM1zg9T/QexbppIti9i0hRNsZ3B4x2sw3J/gueUMT ijvQdEJE2ck24df+5OPGlEz32MUvFZmG6hWgGuebBt2RSpfOOJpeSa0CG89Uet+RRNM1Sp fXxgqhcIou/oaXb6q3SxsJtkxHmCQJqkuG4/vbSGbfGe/ylDQqHGC7MoxTP3ifp7NJ4ySA wBTMW5vA58is6e4MUYZSW3PL7ooXfdFj4pn+ppe5NSJf+UVdc5I0wZ47ywnz5A== 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=1723038268; 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=rb+M5nWNd3cr3MVEa2z6uLURyPWk4yMVVaXqdwnQ2Yg=; b=AZujMzNLBBedsABVH0H1ub7E8BevUbt/LTpTRzY5K9Xso8chB9WHh5VZ+Bs3MqlycoamIE zgGbgz33UwScCNnPxI+H/kOMENtzubDUUS+tCtva6N9iUrUK4Y/HBmVaTI3/zqqpLXNyhl b89of6ey8i/SIszk3GztSEsMsmagQy/qyJX+Xgy85WmWr9FDUpAeW0ijB0011U2yJpyxlZ hkNoA3tOZqQNLc/jx3h8kr1qc8i2K5/4EUx+NtrjAPedHN4t9UpaYRTySQ8DwPrNd+26mW fkXbltD9CzssdiTj13B0IkcaT5EGXdnJUts2CnEKIkd+bqecDJJ9qWY+hYzn0Q== 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 4WfBHJ0hzkzsmN; Wed, 7 Aug 2024 13:44:28 +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 477DiSDF033672; Wed, 7 Aug 2024 13:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 477DiSlx033669; Wed, 7 Aug 2024 13:44:28 GMT (envelope-from git) Date: Wed, 7 Aug 2024 13:44:28 GMT Message-Id: <202408071344.477DiSlx033669@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: b9115dba07e8 - releng/14.1 - ifconfig: Fix default netmask calculation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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.1 X-Git-Reftype: branch X-Git-Commit: b9115dba07e8e7035cb54a7eb319e7166c59c7a4 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b9115dba07e8e7035cb54a7eb319e7166c59c7a4 commit b9115dba07e8e7035cb54a7eb319e7166c59c7a4 Author: Michael Gmelin AuthorDate: 2024-06-12 16:11:52 +0000 Commit: Mark Johnston CommitDate: 2024-08-07 13:32:56 +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 5e3084165b33..e21956cfc4fd 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -440,7 +440,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); @@ -451,11 +451,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