]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: allow nesting of bonding device
authorDi Zhu <zhudi21@huawei.com>
Wed, 23 Jun 2021 03:21:08 +0000 (11:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jun 2021 20:43:44 +0000 (13:43 -0700)
commit13085739f826249ef8405424b1871d363cff3d04
treebe3ace5762dae19b14a72be3c6dd42647fa1675c
parent2fe00c5e06d098778c4e9d8dc8ce8d93a1b8dc52
bonding: allow nesting of bonding device

The commit adf4c997a67f ("bonding: avoid adding slave device with
IFF_MASTER flag") fix a crash when add slave device with IFF_MASTER,
but it rejects the scenario of nested bonding device.

As Eric Dumazet described: since there indeed is a usage scenario about
nesting bonding, we should not break it.

So we add a new judgment condition to allow nesting of bonding device.

Fixes: adf4c997a67f ("bonding: avoid adding slave device with IFF_MASTER flag")
Suggested-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Di Zhu <zhudi21@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c