On 3/9/17 7:52 PM, f...@ikuai8.com wrote: > From: Gao Feng <f...@ikuai8.com> > > When master_idx is invalid, it is zero. It is unnecessary to iterate > all netdevs. Because l3mdev_master_ifindex_rcu(dev) != master_idx must > be true. > Now put this loop into the condition block when master_idx is valid.
you are significantly changing how this loop works, not just the master_idx == 0 case. Basically, if dev does not have an address, you are not going to look at the other interfaces. The if (l3mdev_master_ifindex_rcu(dev) != master_idx) is actually relevant. If dev is enslaved to an L3 device, only consider devices in that domain. Conversely, if dev is NOT enslaved to an L3 device, do NOT consider devices that are enslaved to one. Both of those are equally important.