From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51A06C43219 for ; Thu, 9 Sep 2021 06:52:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22CEE61139 for ; Thu, 9 Sep 2021 06:52:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351103AbhIIGWS (ORCPT ); Thu, 9 Sep 2021 02:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352449AbhIIGWP (ORCPT ); Thu, 9 Sep 2021 02:22:15 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B4F3C061757 for ; Wed, 8 Sep 2021 23:21:06 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id v10so849748wrd.4 for ; Wed, 08 Sep 2021 23:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T/P5hwYJvg55379EY5nkL2g9RcUJ4Qk0S6irJ7oXfp8=; b=W+UD259EkPe7yVYD54ZeuUDK2XXtVw69FdeGCgGEBFc1CDLvunR753GUf7WT+iFzR1 xKkUS2lpR6AbLXNiuWQgOD2aXBsGT3nBfpYjCUFVAzKHREzhUg5++GCq2MsukyfSBP7b fFxDJeEUkHnMc8wr3sq2R49fFTTHOnO2wTn9hQAhEYiqz1YEkTAKWCLklcErvSthgQgA VgnyeoAC0pWRRqLkHxcpUjba7yBB42qYhy/UwLJsXITFm/G0vNpwoPqszFJrkRIIWHPc Ev3bQPSU9UB7aIrWBNw/99QF9jmLn9igvp0kXG2pJUOVVqjwd05txfn2cKz5S3xQoJ+Y U0xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T/P5hwYJvg55379EY5nkL2g9RcUJ4Qk0S6irJ7oXfp8=; b=5C1sB1Hezx7uVBSoQ3kS8QOWPdOM8hQEsbrvFvZnDnUQhwhxPNV1gxw/JNnDJL09WW T0GpELRQPIy7/zISOsOkVFmDZVUrWC+2eg50oDzLC+GHVYIhpja4/MOimbnp45/BUtW3 gGlY+zeR4p3jfyy51jObZ97HDSuk7mm+kjbpyUiTKaS2/rDEAyqqKE5mlaABXCr6X9k0 740+FbM6rrxg5ln+R0f/OOeMfZZ8dm8S6e8f3cRYtYHjaOd1rCzCTAMGopNnjxMjvfUI ux9+I9yDyf1Su0jrWeWXu6TdG96NkdLmhXT13ysboWetkt/dZoctYZUqpMwZgIZPEbVm qapA== X-Gm-Message-State: AOAM5302rilkwMiQKWfKh1/TW2GkuaAbSN+bm0JjLBSm1LAq+1//7VJy a7pEo491q+Apk/4lGVpmSP9U2DxnBHHgC3ORmsXcZA== X-Google-Smtp-Source: ABdhPJxyurFAMG5Msr0Cn839JPUJCDt89L5/yYp8G5tPTW+OD2dBuR/hhgmhcIWQX75+UQqZ+PPPAmO3vMDP4BklB9M= X-Received: by 2002:adf:fc0e:: with SMTP id i14mr1427926wrr.173.1631168464833; Wed, 08 Sep 2021 23:21:04 -0700 (PDT) MIME-Version: 1.0 References: <46a9dbf2-9748-330a-963e-57e615a15440@gmail.com> <20210701085117.19018-1-rocco.yue@mediatek.com> <62c9f5b7-84bd-d809-4e33-39fed7a9d780@gmail.com> In-Reply-To: <62c9f5b7-84bd-d809-4e33-39fed7a9d780@gmail.com> From: Lorenzo Colitti Date: Thu, 9 Sep 2021 15:20:51 +0900 Message-ID: Subject: Re: [PATCH] net: ipv6: don't generate link-local address in any addr_gen_mode To: David Ahern 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?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David, sorry for reviving this discussion, but it felt better than starting a new thread about this. We (Android) added a vendor hook for this, but IMO that's the wrong solution and I think we'd still like to see this fixed the right way. > 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? 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. 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? Cheers, Lorenzo