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=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT 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 69D7CC4320A for ; Mon, 2 Aug 2021 12:57:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E3D660E09 for ; Mon, 2 Aug 2021 12:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233808AbhHBM5Z (ORCPT ); Mon, 2 Aug 2021 08:57:25 -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 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=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT 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 D39EFC4338F for ; Mon, 2 Aug 2021 13:02:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9900460F6D for ; Mon, 2 Aug 2021 13:02:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9900460F6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JLmvF+Gq9OxU3QwDqAq30NN+OaO3zUgmgyiq5fRCfUg=; b=D53D5NVWWEFp4o v049+6R8698FLAV8s5VkOrq8nqQmPOKACGneKmrIQyvxLs6pgZKhDGV4NQKL+vFJJSlB2gHnCtAGq emx24tN1JgvURlC6Q6J3XU1gwt48kHNQVSIref5Ldmx/h+1K5Eirdh1lxIm2Mh6uplyzPsluNaq4i uW/d5PQMBE9exceEBpu9mIk/nK79wEtzhMT5RLl3GgmrXGImr45dZTohuNkSAzXpIoCmB1lk8S+Ri BDfFDt5+4kkELeRXXfOlBi+hy6dNlhpubzZQC7MRDOM3N8hFkkoUhPHD00obt0bFOiLt1mkyKp2Ce CMiuK87JjstK/Xjz3dwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAXaE-00GI4O-2T; Mon, 02 Aug 2021 13:02:18 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAXa9-00GI2Z-Uu; Mon, 02 Aug 2021 13:02:15 +0000 X-UUID: c15ef3b65dc04fd6bf9088479b1bdf95-20210802 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mjfmxFeVls5H/e8H8DAAYokw+x9ZHbmkHst8iBhYLVU=; b=LT41OpDlAM6gBw5A3iG/fqMxXKHwpGD/pKAe9jXdzhxf0b576X0LtRDy0Xk0aP+/8eFj029eOOgpshavMRLAXWukoUijmRUUTIcSwu6QzlApDS4Z5fhvCpulmN1lW2WtIClJtmYhkhvA2jn6W+VuXSIYflnyNf3/UHFS0zTFqg4=; X-UUID: c15ef3b65dc04fd6bf9088479b1bdf95-20210802 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 623239643; Mon, 02 Aug 2021 06:02:10 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Aug 2021 05:57:10 -0700 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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_060214_052217_B710B45D X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT 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 637D3C4338F for ; Mon, 2 Aug 2021 13:04:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2579260F6D for ; Mon, 2 Aug 2021 13:04:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2579260F6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NFEiW6DPo+HJV8txk8rOo2VWtNX9abB8H0X/y676Vjo=; b=fFpDENlSWJVB5F iOAEm21jRJkLZD3mQ9eVoVgzQIQk3Ez/D/2m0a558B+359roGcXJI8WlhiExTFN9483qLI+dFKaKc lK0hpIbVYabpPLBhE+uE04UL0YRpU3rSiYGKT61B9pZvFTEkHF9gDZlBpsNdfki4+EXqHsMybWUV8 DA3S7i0i/iz2uaVEFHcCzl5/FJDOvMJORWIXBdz8snT3yrvjOIxozhfNUqoIIQ78PwR7cx5158tn0 pDymnQmr0TDR/uzbaTEQp23AsQo0IrtrhWol/xuieVdmkTq7KmxZ2dAqEaYFn4SmZyn9xOQQR0zYo meOxpkzBsP0oyS5C5c5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAXaF-00GI4X-UF; Mon, 02 Aug 2021 13:02:20 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAXa9-00GI2Z-Uu; Mon, 02 Aug 2021 13:02:15 +0000 X-UUID: c15ef3b65dc04fd6bf9088479b1bdf95-20210802 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mjfmxFeVls5H/e8H8DAAYokw+x9ZHbmkHst8iBhYLVU=; b=LT41OpDlAM6gBw5A3iG/fqMxXKHwpGD/pKAe9jXdzhxf0b576X0LtRDy0Xk0aP+/8eFj029eOOgpshavMRLAXWukoUijmRUUTIcSwu6QzlApDS4Z5fhvCpulmN1lW2WtIClJtmYhkhvA2jn6W+VuXSIYflnyNf3/UHFS0zTFqg4=; X-UUID: c15ef3b65dc04fd6bf9088479b1bdf95-20210802 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 623239643; Mon, 02 Aug 2021 06:02:10 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Aug 2021 05:57:10 -0700 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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_060214_052217_B710B45D X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel