[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210827094333.4669-1-rocco.yue@mediatek.com>
Date: Fri, 27 Aug 2021 17:43:33 +0800
From: Rocco Yue <rocco.yue@...iatek.com>
To: David Ahern <dsahern@...il.com>
CC: "David S . Miller" <davem@...emloft.net>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>, <rocco.yue@...il.com>,
<chao.song@...iatek.com>, <zhuoliang.zhang@...iatek.com>,
Rocco Yue <rocco.yue@...iatek.com>
Subject: Re: [PATCH net-next v5] ipv6: add IFLA_INET6_RA_MTU to expose mtu value
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
Powered by blists - more mailing lists