From patchwork Wed Oct 20 01:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Suryaputra X-Patchwork-Id: 12571475 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3ED50C433EF for ; Wed, 20 Oct 2021 01:30:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AB59610E7 for ; Wed, 20 Oct 2021 01:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbhJTBc0 (ORCPT ); Tue, 19 Oct 2021 21:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhJTBc0 (ORCPT ); Tue, 19 Oct 2021 21:32:26 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E88CC06161C for ; Tue, 19 Oct 2021 18:30:11 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id g17so1700786qtk.8 for ; Tue, 19 Oct 2021 18:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=Htqzr9Npnuf/0yddHPWnIH+PN+nQ7x9RP1q5QY81LA8=; b=eUCWYcNKAnGfSGKAC/7kd/1Ex3yGJ6cbX0qpnCqHlS48z7hocVn8VYr75mxG0e/USi Q5tggaFTW8/KdJAuG67LDFEb52sL51qoeBlXGfyHsH2Frkt9jNGjrbytgVmz78Sa0yV3 ELfzNmSk6HgXdCsZ34y/bYzbFVILfszxf03Z9mikNnlEjJ7bmLmx2qE8s73jrjYseYp4 SVmJ5dd2TLJPbLoiAOLhfL7RbfFeSpKTc3meI0XcJa6paH1SWVtSAercWWJ9RzjTQbN0 p9/+twr7vHXhDNe6wMXOzZX38XE8IoQo5Z7t96DDx9U4+FpMXqag3KHzgz+70dTQs74t jm6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Htqzr9Npnuf/0yddHPWnIH+PN+nQ7x9RP1q5QY81LA8=; b=qwda0ZR2y24Yiei4gI6j35lQur+wDFZeLOsZeNXXyocBQfUyoo0/BC/Qv3io9iCOx2 l7jwUemsGoy1QzUs4uljWHiiexU+1t0AjRaQUL56ViGR+3MYbK7tOb7dXtaV6Ojzxq9W 2mUkfzJujfFa0YdAj5wkHl6wlhtjvvSUJOZm0RavphOd49Ei6FGUbiUY2FvFouiABrS2 CuWvnbj+8+eXjRzzqdVWOklj2a+w1MRGnCnyUsS+QAVFqBp9kktPWMKKz1iAadUju6jo rwP6Gn7uCqRBjM2u56R74Y76wHumCEVI9HpGDEAjB74/zZIrbkbWHvm/qAKnsHvXhhrf ZD9A== X-Gm-Message-State: AOAM531G6sJZdljzj0QB8PHfiNqs0EAJouwdbkiKSWwSO1uDVajCQmFl D0lalz1RWt7zvqxC6N/t262FL5uhSw== X-Google-Smtp-Source: ABdhPJw3/k2wWIzxcOnvQmxofu0pSql4K/O9Bajdgd7vj4w2lHsXR5ZIyz42DbBKAzB5jRqfEtkxkg== X-Received: by 2002:a05:622a:290:: with SMTP id z16mr3770744qtw.358.1634693410614; Tue, 19 Oct 2021 18:30:10 -0700 (PDT) Received: from ICIPI.localdomain ([136.56.65.87]) by smtp.gmail.com with ESMTPSA id x22sm450590qkp.103.2021.10.19.18.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 18:30:10 -0700 (PDT) Date: Tue, 19 Oct 2021 21:30:05 -0400 From: Stephen Suryaputra To: netdev@vger.kernel.org Cc: a@unstable.cc Subject: Sysctl addr_gen_mode does not control tunnel link-local addr Message-ID: <20211020013005.GA4864@ICIPI.localdomain> MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, I noticed that tunnels, especially sit before commit e5dd729460ca8 ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address"), generates link-local addr regardless of addr_gen_mode setting. Is this a bug, or is there a specific reason? In my system, the link-local addr are generated by a userspace process. So, we set net.ipv6.conf..addr_gen_mode to 1 (IN6_ADDR_GEN_MODE_NONE). The commit e5dd729460ca8 doesn't change the behavior as it is renaming sit_add_v4_addrs() to add_v4_addrs() as make it generic for GRE/IP6GRE cases. I'm not sure what the current behavior is for GRE, i.e. whether addr_gen_mode can control the generation of link-local addr. If this is a bug or oversight, I think this diff should fix it and I can put a formal patch. if (dev->flags&IFF_POINTOPOINT) The commit mention about addressing violation of RFC4291 on GRE and the diff above doesn't cause it to change as the default addr_gen_mode is 0 (IN6_ADDR_GEN_MODE_EUI64). Thanks, Stephen. diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c6a90b7bbb70..da7e83699eef 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3392,6 +3392,8 @@ static void addrconf_sit_config(struct net_device *dev) return; } + if (idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_NONE) + return; add_v4_addrs(idev);