From: Jiri Pirko <jiri@resnulli.us>
To: Xin Long <lucien.xin@gmail.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
network dev <netdev@vger.kernel.org>,
davem@davemloft.net, kuba@kernel.org,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, LiLiang <liali@redhat.com>
Subject: Re: [PATCH net] team: prevent ipv6 link local address on port devices
Date: Fri, 9 Dec 2022 12:11:44 +0100 [thread overview]
Message-ID: <Y5MX8HeU/MJkDwwM@nanopsycho> (raw)
In-Reply-To: <CADvbK_euRvkO8iKmUojb+Vbf6F59VGGxyaDWg5ebLmP51-mj8g@mail.gmail.com>
Thu, Dec 08, 2022 at 06:07:17PM CET, lucien.xin@gmail.com wrote:
>On Thu, Dec 8, 2022 at 6:19 AM Jiri Pirko <jiri@resnulli.us> wrote:
>>
>> Thu, Dec 08, 2022 at 12:35:48AM CET, lucien.xin@gmail.com wrote:
>> >On Wed, Dec 7, 2022 at 8:31 AM Jiri Pirko <jiri@resnulli.us> wrote:
>> >>
>> >> Tue, Dec 06, 2022 at 10:52:33PM CET, lucien.xin@gmail.com wrote:
>> >> >On Tue, Dec 6, 2022 at 8:32 AM Xin Long <lucien.xin@gmail.com> wrote:
>> >> >>
>> >> >> On Tue, Dec 6, 2022 at 3:05 AM Jiri Pirko <jiri@resnulli.us> wrote:
>> >> >> >
>> >> >> > Mon, Dec 05, 2022 at 06:46:05PM CET, lucien.xin@gmail.com wrote:
>> >> >> > >The similar fix from commit c2edacf80e15 ("bonding / ipv6: no addrconf
>> >> >> > >for slaves separately from master") is also needed in Team. Otherwise,
>> >> >> > >DAD and RS packets to be sent from the slaves in turn can confuse the
>> >> >> > >switches and cause them to incorrectly update their forwarding tables
>> >> >> > >as Liang noticed in the test with activebackup mode.
>> >> >> > >
>> >> >> > >Note that the patch also sets IFF_MASTER flag for Team dev accordingly
>> >> >> > >while IFF_SLAVE flag is set for port devs. Although IFF_MASTER flag is
>> >> >> > >not really used in Team, it's good to show in 'ip link':
>> >> >> > >
>> >> >> > > eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP>
>> >> >> > > team0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP>
>> >> >> > >
>> >> >> > >Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device")
>> >> >> > >Reported-by: LiLiang <liali@redhat.com>
>> >> >> > >Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> >> >> >
>> >> >> > Nack. Please don't do this. IFF_MASTER and IFF_SLAVE are historical
>> >> >> > flags used by bonding and eql. Should not be used for other devices.
>> >> >> I see. I was wondering why it was not used in Team at the beginning. :)
>> >> >>
>> >> >> >
>> >> >> > addrconf_addr_gen() should not check IFF_SLAVE. It should use:
>> >> >> > netif_is_lag_port() and netif_is_failover_slave() helpers.
>> >> >Hi Jiri,
>> >> >
>> >> >Sorry, it seems not to work with this.
>> >> >
>> >> >As addrconf_addr_gen() is also called in NETDEV_UP event where
>> >> >IFF_TEAM_PORT and IFF_BONDING haven't yet been set before
>> >> >dev_open() when adding the port.
>> >> >
>> >> >If we move IFF_TEAM_PORT setting ahead of dev_open(), it will revert
>> >> >the fix in:
>> >> >
>> >> >commit d7d3c05135f37d8fdf73f9966d27155cada36e56
>> >> >Author: Jiri Pirko <jiri@resnulli.us>
>> >> >Date: Mon Aug 25 21:38:27 2014 +0200
>> >> >
>> >> > team: set IFF_TEAM_PORT priv_flag after rx_handler is registered
>> >> >
>> >> >Can we keep IFF_SLAVE here only for no ipv6 addrconf?
>> >>
>> >> So, shouldn't it be rather a new flag specifically for this purpose?
>> >Maybe IFF_NO_ADDRCONF in dev->priv_flags?
>>
>> Sounds fine to me.
>BTW, IFF_LIVE_RENAME_OK flag was just deleted in net-next.git by:
>
>commit bd039b5ea2a91ea707ee8539df26456bd5be80af
>Author: Andy Ren <andy.ren@getcruise.com>
>Date: Mon Nov 7 09:42:42 2022 -0800
>
> net/core: Allow live renaming when an interface is up
>
>do you think it is okay to use that vacance and define:
>
>IFF_NO_ADDRCONF = BIT_ULL(30)
>
>in netdev_priv_flags ?
It's a private define, no UAPI, I don't see why not. Let's make the
backporter live a bit harder :)
>
>Thanks.
>
>>
>>
>> >
>> >I will give it a try.
>> >
>> >Thanks.
prev parent reply other threads:[~2022-12-09 11:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 17:46 [PATCH net] team: prevent ipv6 link local address on port devices Xin Long
2022-12-05 18:39 ` Stephen Hemminger
2022-12-06 8:05 ` Jiri Pirko
2022-12-06 13:32 ` Xin Long
2022-12-06 21:52 ` Xin Long
2022-12-07 13:31 ` Jiri Pirko
2022-12-07 23:35 ` Xin Long
2022-12-08 11:19 ` Jiri Pirko
2022-12-08 17:07 ` Xin Long
2022-12-09 11:11 ` Jiri Pirko [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=Y5MX8HeU/MJkDwwM@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=liali@redhat.com \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stephen@networkplumber.org \
/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