From nobody Wed Jun 12 16:14:53 2024 X-Original-To: current@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 4VzrHW4zFSz5N0f7 for ; Wed, 12 Jun 2024 16:15:35 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VzrHW4Qjpz4cbX; Wed, 12 Jun 2024 16:15:35 +0000 (UTC) (envelope-from grembo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718208935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vi3KDmhvbKGrKSPZbo1I1T2JLNQNiXNB3P+howRwt4Y=; b=PntHzq0hlsfcdsX1xRrjVN8k14d9LQCOrhI/O6CmNdMsrUW+tQyspqtZi/tvtOYqzmCJAw rT2F45ZgXc1DibYagMbs29TyZlYu1ePSqySzL01AUpQGVG8TIn5HcKhFJVoIg03yZfIf3W z2OvMrVA3IsGVoZ2GrJQnmvZ8KgVCKrH/x1rqEKnTLrckKguR2cjbyYI5M2rztQxVHDQ8w FJ4UyzOMNj/LR7eNXFORSrLTeyU2xzFjTZZIsgt0UBJoWm1zzOWPkDIwvMml//Vm21+OZh NMF6KYWzo09WxbwsfBfMYeXXQIT4zlV4ErkwQGallY+jpwPvR2pqXlqOc9i8sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718208935; a=rsa-sha256; cv=none; b=wPUmSUYkdHv0sF6Rv5JNL9kTIBghJqkbB0+MFE5nxWGTW3Tf27abXdsYVDns8o/JOglW8j 5Y+6ZbSVEMHLv02HUjVpuzEo7VVvBDDqsN4OAy+TEaPcCL95BpnSDJYBMIvPVLqcBR8by8 c/SU+LA6txbnr+RJzc1joEBlyweYV6KO+0HeJ8xiMy1oEcnQfQkS1040P4Cr1vVDUVhk7C Ox8dG7cWxkw4Bz9qVvJsCfPVCofsMQCvpEVp8QhRqR5SlIPXZYY6OuP6SgN6veJ/FyOd5x ZssRiAgdFKAVZcJS5k5TM6ZASqT6+ebIxsq5VQuZJbXoYFD5jcEalvLIcpSl4g== 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=1718208935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vi3KDmhvbKGrKSPZbo1I1T2JLNQNiXNB3P+howRwt4Y=; b=hSoLhIytVRcVp7hkjYMFZiTTNjzbcN8EGafkDMu7R1xjkX5dSQdAWdX0ts2GEqHDjFk95t GUPbkLCvRo7pVtJ8AyCka9QgzosLQu8PkNB4seWSu+unOnQNo6KFARXAMT/vmGCAQ0e9Tz kCgO1gnbP3ygfpqfMia+q/WaUEwduVF26aFaAAylt9HFSPnK7x2QbW9emjr/4I0ugZ5GtL j36otMOr3NHiiwaPgJQxycG9FMx1jjTkHPu4H1aVMEb7fLg/VaE5uQC6TWldooXPv/23wQ meE4gZWjo0yaDmwkiVXod7O2kzyuUWTsKw4o6NOxeFcSVw0Xk5J5cXSjAZvHyA== Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) (Authenticated sender: grembo/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VzrHW0Xylz1Cvd; Wed, 12 Jun 2024 16:15:34 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 3f261a8b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 12 Jun 2024 16:15:33 +0000 (UTC) Date: Wed, 12 Jun 2024 18:14:53 +0200 From: Michael Gmelin To: "Poul-Henning Kamp" Cc: Michael Gmelin , "Bjoern A. Zeeb" , current@freebsd.org Subject: Re: 14.1-R rc.conf/ifconfig netmask issue was really hard to figure out Message-ID: <20240612181453.17715d51.grembo@freebsd.org> In-Reply-To: <202406121535.45CFZwgS011605@critter.freebsd.dk> References: <202406120747.45C7lRGZ009491@critter.freebsd.dk> <5ss109s8-1086-700s-p199-rpr429on41p9@yvfgf.mnoonqbm.arg> <202406121436.45CEaZ0o011207@critter.freebsd.dk> <20240612165722.5ec89d11.grembo@freebsd.org> <05ors010-q60q-s261-no16-1577rq1p1610@yvfgf.mnoonqbm.arg> <404q3127-9p57-1oqq-qqoo-3479q27830ss@yvfgf.mnoonqbm.arg> <20240612172936.52cf62f0.grembo@freebsd.org> <202406121535.45CFZwgS011605@critter.freebsd.dk> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 12 Jun 2024 15:35:58 +0000 "Poul-Henning Kamp" wrote: > -------- > Michael Gmelin writes: > > > @phk From which version did you upgrade? > > To be totally honest: I'm not entirely sure. Probably 13.x > @Bjoern I checked again, I'm pretty sure the problem was introduced in https://cgit.freebsd.org/src/commit/?id=4bf44dd73bc0a (this was part of adding netlink into the code). The preparation work by the late Mike Karels was consistent, as one can see in 13.x. So basically the behavior on 13.x is: - ifconfig bla0 10.1.1.1 => 10.1.1.1/8 - ifconfig bla0 192.168.1.1 => 192.168.1.1/24 This is in line with one would expect. On 14.x it's the opposite. The code in 4bf44dd73bc0a68b73f7ee50d52adf5d7cda3eb8 introduced a function to emulate the previous behavior. This function uses IN_CLASSX_NSHIFT as bitmask - therefore 10.1.1.1 uses /24 and 192.168.1.1 uses /8. To fix the code, one has to actually use the bitmask, which is (32 - IN_CLASSX_NSHIFT). So this is simply a bug. I opened a code review request to fix this: https://reviews.freebsd.org/D45570 Best Michael -- Michael Gmelin