From nobody Sat Jun 15 15:26:17 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 4W1g3F5XWFz5NyYC; Sat, 15 Jun 2024 15:26:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W1g3F51Twz4Q1T; Sat, 15 Jun 2024 15:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718465177; 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=FeuWwHJQPMS66L0P5a6sELY60q7jaOwzDkr9vVaFX0E=; b=xhUqMYtSh8wxwK0wLPjSgHhSzTmxr/5Joh4SCSnho29HRashOOgXyt34czb0V/YklyTig6 yvx7tPDeMP2g2GUCm8lp1vDvfEurEHgrBRaJ3tpgyd/1LyBSGAByw0LvHFcqOsy7zziKs+ Nh/SMUhpKJ0mT+5JhJkm3g4rfgnmldZfbX3DNsj6gNYj/u8gZc2BfWO3KB4JlAEVw/0lxy QX12RFZjHHaVzN+Jnh1lbiTuzBI9rVXWOKYCuhx7bc2apzwgx5w4cZi3uZ9c2L92mO/riH oaxyi6wNDWYdje49pjqYZqnd0IIcVZibDJab6QUSeosGxmDwwmXnRIGCSoCH1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718465177; a=rsa-sha256; cv=none; b=PCaNz63a3HheJIuNWw/v8rb//qperA7yRg5ycDuVBbRfpdYe8rHfMpj5EvRXvAcTuoF+jB gFdmUQ8Ym4kkOkz9GNvTP6Vxq7Wxlkk0KzC/LAk+qFaiDxuKjqn/EY/yuYmZWHsNJwzren 3sUfKqIyTwsEByDpC25ffx0NQvF4O9DA8FoX4nsfHemQn+TIWDLAonCtD//8StOGW0WIYb PP7xWX7fbZ/nu0SBp2WmtaVz8kMnoa5Yg/t+rhEe4Q1PoS5JKj5HUDdpwCr6cbPjJGpuIk 68zAip0CQHYMWZJLMuLS3fOEzvO2VNToHR5QgFHmZ/XBXQJdTCpxT9nn6VtksQ== 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=1718465177; 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=FeuWwHJQPMS66L0P5a6sELY60q7jaOwzDkr9vVaFX0E=; b=R74zWuKhQ6Ttr0bL2htGcp7TnFVWcDnSVV/cvRfzG8a8763wi82xZgW9y21m+Eu9nnIo0R gSlsC/pPq8Zje7vEOIL7F40plxkMyv6S9UycioU90XC71r6WIVdvvpwhPZwV0F6ZUDAvWn Od0nf0kpL+OT57yxVOzBsV4EltK7CtGB2bLmkuIwbkRz4c14xGLOBa8cMXv1UwF4f5OEHA eqN97PALSqqfG5Zm3eiAbAGIuMg8Mahtpo/UhrnLj+P9Ut7dmsr4pFXI1GojRtacL9Sei3 BZ34srPNexxOU8E3pVzJgvUaE75eLyr0qWuu+L6z6/893HuJLSR/iRXMrC/vFA== 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 4W1g3F4GQPz18hs; Sat, 15 Jun 2024 15:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45FFQHxE020533; Sat, 15 Jun 2024 15:26:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45FFQHcQ020530; Sat, 15 Jun 2024 15:26:17 GMT (envelope-from git) Date: Sat, 15 Jun 2024 15:26:17 GMT Message-Id: <202406151526.45FFQHcQ020530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Gmelin Subject: git: 048ad7a9ef9f - stable/14 - 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: grembo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 048ad7a9ef9fe15368ff287db5c705c8163f4e1c Auto-Submitted: auto-generated The branch stable/14 has been updated by grembo: URL: https://cgit.FreeBSD.org/src/commit/?id=048ad7a9ef9fe15368ff287db5c705c8163f4e1c commit 048ad7a9ef9fe15368ff287db5c705c8163f4e1c Author: Michael Gmelin AuthorDate: 2024-06-12 16:11:52 +0000 Commit: Michael Gmelin CommitDate: 2024-06-15 15:24:59 +0000 ifconfig: Fix default netmask calculation Reported by: phk Reviewed by: emaste, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45570 (cherry picked from commit 8a9f0fa42b1c6cffd45459bb552e138083b00369) --- 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