From nobody Wed Jun 12 18:11:51 2024 X-Original-To: dev-commits-src-main@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 4Vztsg5q0tz5N9vg; Wed, 12 Jun 2024 18:11:51 +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 4Vztsg5B1pz4y7L; Wed, 12 Jun 2024 18:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718215911; 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=vRApA9KRTMxSSfVExWHkNhd6j5y0u5UuChn3JBrLenE=; b=HvNCDJB5r03dtEs5GO1sf8+ExhJpEoDnAGkfH6Fc1AxXnaSJCQWye1Ld//6HyJVV4c4Cct Vu02OoMeVkxBq2xt3gMu5nIa60kjWvj9RbLsr4hmMM/EbSaVz3iAs7L/rDg/Zd9Wny4gu0 JcQteT8mhuyaOlA9lXr7W1N64Nf0owONbNZfzcjp/fo0B3wCrh8dt0arRVQ98WdCNZIszZ 5YflI1Dr+vMuzxa/fazqqIn3B5YICbKHii/HcO8uhmmzunjcE0/r6m2jc5pNe46VIWNXDk VGr3SrJHhiwXUQtJq9O/ElWjBH7vwi/4uxSdLvimIXqvgzHseMdLnrvJkyJKdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718215911; a=rsa-sha256; cv=none; b=AzU8KHEs2MIXpBK7lN5i1ABlvzRykycBjINbrCg9nnqOKERGjN5yDJ54mKGsCbXZ7a6U1B vP/CKzPdz/acDiYxMUmP9zZ0J3ZMRdN7//qXm2Eblt9zLYqUcSmFzHyMRvve34nNEjtavb kINhN+xU7xJssCeXWu1/URKdgTA4e6c8dKHgFv/6Oqk/sjncVReUbTluyQdhGvng2lxkEa zxz+87TUnj/+RcedhDRHWT8jaSxAzEsNiZ7oULnFYSY7dWCJ5zAqLQqeVELah5bLretTQW OkWJvhqM5yVqdJi+hB2sNugP1MZee7qdsNCSP3bVwnPh6/K89ezDyAI0URnZgQ== 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=1718215911; 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=vRApA9KRTMxSSfVExWHkNhd6j5y0u5UuChn3JBrLenE=; b=jdvKNv6EfVq+xFxaeaxSOrIUboxr4Y5VixIeqYKRaqKvYEAoNNTh0pgVRV1coaT6dBFJot 5rkM6uTHSzn41y7W65HoOtzqMjp6Qwkcleu4+kdtNcbqF7hAjDJPhdV01LBYM/lVxVfUnL GEgpdf7ofpN9zXU3dPdNZ81EFAU8oP9y0zdsu2X1YWXqb/+4Vt2QPjY1aysLAhpKbs5BOU 8foSc9kRc1e7vJ5gBYj5xkr9Qbc7xbcaoYH0SioaXQN8CblSUPTzkMUoZ3ZdGGZd1IfO0g gaGa3myOygmWEno6PELB60ceS8502FhIqWJnptK9nJTy/lhFcMpcprvJ2Rc2nw== 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 4Vztsg4nQ4z13lW; Wed, 12 Jun 2024 18:11:51 +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 45CIBp7L097993; Wed, 12 Jun 2024 18:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CIBpmf097990; Wed, 12 Jun 2024 18:11:51 GMT (envelope-from git) Date: Wed, 12 Jun 2024 18:11:51 GMT Message-Id: <202406121811.45CIBpmf097990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Gmelin Subject: git: 8a9f0fa42b1c - main - ifconfig: Fix default netmask calculation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8a9f0fa42b1c6cffd45459bb552e138083b00369 Auto-Submitted: auto-generated The branch main has been updated by grembo: URL: https://cgit.FreeBSD.org/src/commit/?id=8a9f0fa42b1c6cffd45459bb552e138083b00369 commit 8a9f0fa42b1c6cffd45459bb552e138083b00369 Author: Michael Gmelin AuthorDate: 2024-06-12 16:11:52 +0000 Commit: Michael Gmelin CommitDate: 2024-06-12 18:10:13 +0000 ifconfig: Fix default netmask calculation Reported by: phk Reviewed by: emaste, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45570 --- 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