Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp796510pxb; Thu, 9 Sep 2021 12:14:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJzMF7b4U0T07i4sVIkeJQTJwFihP4jYPzQ38EujzORDLJYclSk1IPPoMY0oaTFF7tpjS+ X-Received: by 2002:a02:7f11:: with SMTP id r17mr1275191jac.94.1631214853074; Thu, 09 Sep 2021 12:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631214853; cv=none; d=google.com; s=arc-20160816; b=dSMhPCAUyJra4nu2LEr36lD19sIo0p9Fu5A8OM8LAOO6bJ+Y37SvrcW+iAI1qH/nYJ bMwSFHG8yCJd3Gz+ifyAflfG686fxTcBY1l1Q1DkEmR5RX8cBozphSOp3pHlJnvBmQUA ZI1WxVYWwo6lJrODgqFH+nalqU3E9PqTiS6+01Bs2+VeUV5H85M55zPQt2ebEVo8F2bb mlwv+/QPOqgv1yFqRm5Q0RLiq1vMocXw0hJ1k0qqiwdVtGvP5CQELklBArQHzI99MXJL 2d1HJlhi4dLkEsmpS/s55ys9quhRjqf1aGfWPYEouHhHNxFZlc011S+3Cg3qKGfpRJmP 2l8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=qPQHwAFiSYdLyleAbELrQZ2a09NIC4IXr92lC8k0Z2o=; b=Z9lrEjAsdlvhz/6je5iYDkNy4aG0vy4iR7GgipBjcL+CKvslXiOWjFaS7LEJHzzIYN qRT7oTz7/79MuokMv+Ycq+hY78W72bLcULLKBMTrET+BHzVZUCswIh0eS0TBWh/LX5A7 SWxZxLXWt8G9RSmt5H9pz/3U337nkPseBIT90HZturo/Bb9aNquMvg9WrovGEjLBZjsp iPcQ0cYOWdtGSgqrHIR8HqEZWgbmjOg/LDDyoPGROP/v3ZMvpbakn1mivGXmLPTDXXpE 1CuBVtFebn4bj5tQcc/rDc3DaRwxe9qHyhLIkdanDSPYZ2uIN188cIikd2K2UQUUz+Ph 3B7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iP93NZjL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si2550904ilc.159.2021.09.09.12.13.59; Thu, 09 Sep 2021 12:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iP93NZjL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237617AbhIITNu (ORCPT + 99 others); Thu, 9 Sep 2021 15:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231425AbhIITNt (ORCPT ); Thu, 9 Sep 2021 15:13:49 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3A22C061574; Thu, 9 Sep 2021 12:12:39 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id y128so3899765oie.4; Thu, 09 Sep 2021 12:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qPQHwAFiSYdLyleAbELrQZ2a09NIC4IXr92lC8k0Z2o=; b=iP93NZjLCWK7wrqXWEzIuyPF1eZNfnZ3JjpCM3RA+qd12seWfFmLUQQbh+/RrxpGmj ENQ8gOluBLG8GHQBb+a97ETd6UUMNun19AFQwNotAQqAdX27mfavG+nw0dNPuLCBqUnj Slj6zu9FeZDMvZgcz51saRw1LklQCwZSjgoemHLLI6hM4s7/i75qfYjqhS+kY/kdG65l a/EUPjXbQjZYFgENdYljH7VsPsAPkSdnX/JDpdMEO9TxVkMY1EDW12ESbmKouOuC4BG1 xwWKt8CWA5ypzZ8KgPSxKgDua/+uNGDAhtQsXwO9G5+SjqVMkgRPBCMsyS1PlTQHU7iE m97A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qPQHwAFiSYdLyleAbELrQZ2a09NIC4IXr92lC8k0Z2o=; b=bUdSW1MsJpiTanugR1uY2Q73ijjrGtB3e1u5zWLh9DO+GkT4X86ZykKGNC6vGBZ8ze njYVcTVM2ygdwP6Dp9IUUA0F/oaVwDb4td7i7k6OJn39jxj/Es7MEDm4YMlfVxt0qaWC 1zHcuXgPyn9dR4/1FmtStWDj7Np8MSBKYfdr02IL7+N57Ndp0P0fGqBs2YpJ4dK8GG6B 8yRDwVSv2gEKitXwDVfD9TT9zXDAOX4N4sNNtYNvWMzpxX+/iLyWU+eeJOcx3QXref5u hMfHzgXawnDfOI1LhDtOZEbu56jGuv80uGsCboVEjC6M1NYLJkRzjYy9FCDNv4VB8E6+ 7vbg== X-Gm-Message-State: AOAM531bai/98D8crKhr5cF/Nq3717AJ1BTHrTNbxFpnVCOrzWDDxCuM /qvAZyaXELpOr3asIIsYI0o= X-Received: by 2002:a05:6808:1481:: with SMTP id e1mr1037664oiw.5.1631214759289; Thu, 09 Sep 2021 12:12:39 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([2601:282:800:dc80:395a:c:3f8e:f434]) by smtp.googlemail.com with ESMTPSA id w1sm651917ott.21.2021.09.09.12.12.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 12:12:38 -0700 (PDT) Subject: Re: [PATCH] net: ipv6: don't generate link-local address in any addr_gen_mode To: Lorenzo Colitti Cc: Rocco Yue , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Matthias Brugger , Linux NetDev , lkml , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, rocco.yue@gmail.com, chao.song@mediatek.com, =?UTF-8?B?S3VvaG9uZyBXYW5nICjnjovlnIvptLsp?= , =?UTF-8?B?Wmh1b2xpYW5nIFpoYW5nICjlvKDljZPkuq4p?= References: <46a9dbf2-9748-330a-963e-57e615a15440@gmail.com> <20210701085117.19018-1-rocco.yue@mediatek.com> <62c9f5b7-84bd-d809-4e33-39fed7a9d780@gmail.com> From: David Ahern Message-ID: <6a8f0e91-225a-e2a8-3745-12ff1710a8df@gmail.com> Date: Thu, 9 Sep 2021 13:12:37 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/9/21 12:20 AM, Lorenzo Colitti wrote: >> I think another addr_gen_mode is better than a separate sysctl. It looks >> like IN6_ADDR_GEN_MODE_STABLE_PRIVACY and IN6_ADDR_GEN_MODE_RANDOM are >> the ones used for RAs, so add something like: >> >> IN6_ADDR_GEN_MODE_STABLE_PRIVACY_NO_LLA, >> IN6_ADDR_GEN_MODE_RANDOM_NO_LLA, > > I think the real requirement here (which wasn't clear in this thread) > is that the network needs to control the interface ID (i.e., the > bottom 64 bits) of the link-local address, but the device is free to > use whatever interface IDs to form global addresses. See: > https://www.etsi.org/deliver/etsi_ts/129000_129099/129061/15.03.00_60/ts_129061v150300p.pdf > > How do you think that would best be implemented? There is an established paradigm for configuring how an IPv6 address is created or whether it is created at all - the IFLA_INET6_ADDR_GEN_MODE attribute. > > 1. The actual interface ID could be passed in using IFLA_INET6_TOKEN, > but there is only one token, so that would cause all future addresses > to use the token, disabling things like privacy addresses (bad). > 2. We could add new IN6_ADDR_GEN_MODE_STABLE_PRIVACY_LL_TOKEN, > IN6_ADDR_GEN_MODE_RANDOM_LL_TOKEN, etc., but we'd need to add one such > mode for every new mode we add. > 3. We could add a separate sysctl for the link-local address, but you > said that per-device sysctls aren't free. per-device sysctl's are one of primary causes of per netdev memory usage. Besides that there is no reason to add complexity by having a link attribute and a sysctl for this feature. > 4. We could change the behaviour so that if the user configures a > token and then sets IN6_ADDR_GEN_MODE_*, then we use the token only > for the link-local address. But that would impact backwards > compatibility. > > Thoughts? We can have up to 255 ADDR_GEN_MODEs (GEN_MODE is a u8). There is established code for handling the attribute and changes to it. Let's reuse it.