Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1162994pxb; Fri, 27 Aug 2021 02:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/cfeE+GgQWIKPlQ9zg4URtfCHfSPKo2SdZAlbyW0upRfEeLTP6/WAWG+WjgYmLXh1faG2 X-Received: by 2002:a92:d68a:: with SMTP id p10mr5917034iln.179.1630057490474; Fri, 27 Aug 2021 02:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630057490; cv=none; d=google.com; s=arc-20160816; b=MtEeeMD8PqF7QIicy94fO4hVFJa/+tbKk2KTMijZI5sYhhFaeaS0zGECuMwpJfVpyy St+f020VEMZ9TWEeVXyv7CMrfOg4IPG1xW7Mit7quEcw68887X8eviFBV6YmJ3K5iuSg 7FKThjq5kUj8N+r5w06cknP5E+qQySh/WQxVLLy0mjckajKwR6R7wVuG3MJOX5bQb07P +8NQza4xi+WV85g2APPoltiRJNdvmNMjvN8hxqldbeiRsoFb3UG2lQ8FPGea+8613dDT Zw05DOGE6qsPHTpg71iY+W+N4YZTBZSv/DgrlNCc6SM2Eb9pYc3m8o20i8OMudlDFdBE AOTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=PbgjXu4AAYklh2iGWrZOYBurySlCzW18d6OFK4637Nk=; b=n91UPWZEp3kZPnmRX6GqFhCIakkGWc8wvht3gqG+tdvRuKVfquFh9Jnjq7FeVQSiCm VZF3eYNBbJEma3PA0bH2lqXWbwEJnz4kDFvjq94ahTtePwlWY0A2G/UPE19bAkxNYGlb ggSolxapgR0GEJ+FFNB4Q+DwYjF+4HLn9f3RJ540J5MpLbraC5PbTptEG9I304HTyitv wEp0Y0z6glaUXHUfYVrVOYWqO9jBv6MSQ2EQt5d2pUy3nY6ihwnsSYAlQINEZpOBG5fD oLa4uK9gtS4c5WckOQ8tcavZUbHRWwKRd+tMlXYi5dbQH0b0jYSWRZiBuzLLEs4sHShi Ffhg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si7285781ilu.53.2021.08.27.02.44.39; Fri, 27 Aug 2021 02:44:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244813AbhH0Jop (ORCPT + 99 others); Fri, 27 Aug 2021 05:44:45 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:57434 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S244649AbhH0Jop (ORCPT ); Fri, 27 Aug 2021 05:44:45 -0400 X-UUID: 5eea3328230147b086203df54e390770-20210827 X-UUID: 5eea3328230147b086203df54e390770-20210827 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2106127847; Fri, 27 Aug 2021 17:43:51 +0800 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 27 Aug 2021 17:43:50 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 27 Aug 2021 17:43:50 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 27 Aug 2021 17:43:49 +0800 From: Rocco Yue To: David Ahern CC: "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Matthias Brugger , , , , , , , , Rocco Yue Subject: Re: [PATCH net-next v5] ipv6: add IFLA_INET6_RA_MTU to expose mtu value Date: Fri, 27 Aug 2021 17:43:33 +0800 Message-ID: <20210827094333.4669-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <6a870141-089d-5e2b-48a7-448695e26238@gmail.com> References: <6a870141-089d-5e2b-48a7-448695e26238@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-08-27 at 13:28 +0800, David Ahern wrote: > On 8/25/21 11:46 PM, Rocco Yue wrote: >> @@ -5651,6 +5654,9 @@ static int inet6_fill_ifla6_attrs(struct sk_buff *skb, struct inet6_dev *idev, >> if (nla_put_u8(skb, IFLA_INET6_ADDR_GEN_MODE, idev->cnf.addr_gen_mode)) >> goto nla_put_failure; >> >> + if (nla_put_u32(skb, IFLA_INET6_RA_MTU, idev->ra_mtu)) > > I should have seen this earlier. The intent here is to only notify > userspace if the RA contains an MTU in which case this should be > > if (idev->ra_mtu && > nla_put_u32(skb, IFLA_INET6_RA_MTU, idev->ra_mtu)) > Hi David, Thanks for your pretty suggestion. When ra_mtu = 0, notify userspace is really unnecessary. At first I did this because when userspace get ra_mtu = 0 through getlink, then the corresponding operation can be performed. After adding the restriction of "idev->ra_mtu", I think userspace can judge whether the mtu option is carried in the RA by judging whether it can be parsed to IFLA_INET6_RA_MTU after getlink, and perform the corresponding operation. I will push the next version. > and in which case idev->ra_mtu should be initialized to 0 explicitly, > not U32_MIN. will do. Thanks