From: Rocco Yue <rocco.yue@mediatek.com>
To: David Ahern <dsahern@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
David Ahern <dsahern@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>, <rocco.yue@gmail.com>,
<chao.song@mediatek.com>, <zhuoliang.zhang@mediatek.com>,
Rocco Yue <rocco.yue@mediatek.com>
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 [thread overview]
Message-ID: <20210827094333.4669-1-rocco.yue@mediatek.com> (raw)
In-Reply-To: <6a870141-089d-5e2b-48a7-448695e26238@gmail.com>
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
prev parent reply other threads:[~2021-08-27 9:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 6:46 [PATCH net-next v5] ipv6: add IFLA_INET6_RA_MTU to expose mtu value Rocco Yue
2021-08-27 5:28 ` David Ahern
2021-08-27 9:43 ` Rocco Yue [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210827094333.4669-1-rocco.yue@mediatek.com \
--to=rocco.yue@mediatek.com \
--cc=chao.song@mediatek.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rocco.yue@gmail.com \
--cc=yoshfuji@linux-ipv6.org \
--cc=zhuoliang.zhang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).