Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1602340pxy; Mon, 2 Aug 2021 06:01:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz46FUuXH7tES9g5xe0X7arMAKfeNEjz/R5AGsu/URR3qLAowMpPJwtFMnTUc9CzcArJPMV X-Received: by 2002:a19:f004:: with SMTP id p4mr13055783lfc.503.1627909287547; Mon, 02 Aug 2021 06:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627909287; cv=none; d=google.com; s=arc-20160816; b=Dsjj6v8hIrbPLyWW3O2oZRn4adHEMoKnMJaiuVC2KUQKEVfC/cNV/hoXKqEvBbE+Sr dGDqFnO9npO/ZiMNANRvJYTaR5c+gqhJWffl99QCqKsOVWNUE6S9YD7NY0F3VIbQZa7m 604o4GBx7no2xoTv9flDpx8Hqlhx7kA4oymq01QZ3WeNycQb8MJQRJ47ANirRLHoQi67 H2hbewxQh8a/EViovw13vOBEEbKnf2wkZzSgCe7TteR2QLgYjCnAc+QDm96O5O9F2VFQ RVxlms+Zs73S2guPVINo/w2t2frS7piWSwCwQrrQCHtWaM1tr+MROaW4T3P5LZemZMJ7 mGug== 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=sb4jm5b+lILR33xuS/cIyZFHYTxl4J5mZusmJ54maNY=; b=L/7xzICic3QOwoW8yjXqktRZPBZVttH6r0C7kIYxISFfNYwMtyim54cSVeujuGA1kQ R/nbG47VHauf9o1xToK3fmS48nWm6vN4VUACrcOSF8Hvdu6klFn+cZyNYrzm0oebSD8K 9wTCauwF/FNbFsucmTW45qqXQwQ0xcM9oK8ZgPxgJv+X5hW+o1lbhpJHCwOjQFuXFlP3 b/DYbrn1aLMTXjI6RQLPObBbY2mqWLMm5tIopLNtWsKvobZBcu9cAJNKfoyd+W7WYL0l LCCmu1fy4V6pJBGF3cSZTciOdoFlCMDRZMLtGFe1unXWNIQFrB7QBmgTbp3HpDSs8ooH xceQ== 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 m1si10233877ejj.198.2021.08.02.06.01.03; Mon, 02 Aug 2021 06:01:27 -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 S233789AbhHBM5Y (ORCPT + 99 others); Mon, 2 Aug 2021 08:57:24 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:45230 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233678AbhHBM5W (ORCPT ); Mon, 2 Aug 2021 08:57:22 -0400 X-UUID: be321d17faa848ce8adf61ad9d539a67-20210802 X-UUID: be321d17faa848ce8adf61ad9d539a67-20210802 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1587694583; Mon, 02 Aug 2021 20:57:10 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Aug 2021 20:57:08 +0800 Received: from localhost.localdomain (10.15.20.246) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 2 Aug 2021 20:57:07 +0800 From: Rocco Yue To: David Ahern CC: "David S . Miller" , Jakub Kicinski , Hideaki YOSHIFUJI , , , , , , , , Rocco Yue Subject: Re: [PATCH net-next v2] ipv6: add IFLA_INET6_RA_MTU to expose mtu value in the RA message Date: Mon, 2 Aug 2021 20:40:39 +0800 Message-ID: <20210802124039.13231-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210802031924.3256-1-rocco.yue@mediatek.com> References: <20210802031924.3256-1-rocco.yue@mediatek.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 Sat, 2021-07-31 at 11:17 -0600, David Ahern wrote: On 7/30/21 7:52 PM, Rocco Yue wrote: > IFLA_INET6_RA_MTU set. You can set "reject_message" in the policy to > return a message that "IFLA_INET6_RA_MTU can not be set". Hi David, Regarding setting "reject_message" in the policy, after reviewing the code, I fell that it is unnecessary, because the cost of implementing it seems to be a bit high, which requires modifying the function interface. The reasons is as follows: The parameter "struct netlink_ext_ack *extack" is not exposed in the function inet6_validate_link_af(), and the last argument when calling nla_parse_nested_deprecated() is NULL, which makes the user space not notified even if reject_message is set. static int inet6_validate_link_af(...) { ... err = nla_parse_nested_deprecated(tb, IFLA_INET6_MAX, nla, inet6_af_policy, NULL); ... } Only when extack is not NULL, reject_message is valid. static int validate_nla(...) { ... switch (pt->type) { case NLA_REJECT: if (extack && pt->reject_message) { NL_SET_BAD_ATTR(extack, nla); extack->_msg = pt->reject_message; return -EINVAL; } err = -EINVAL; goto out_err; ... } Thanks Rocco