Commit 53f02ec2 authored by Stephen Hemminger's avatar Stephen Hemminger

[BRIDGE]: Use dev_base_lock while traversing netdev list.

parent ab627fcf
...@@ -252,12 +252,12 @@ int br_get_bridge_ifindices(int *indices, int num) ...@@ -252,12 +252,12 @@ int br_get_bridge_ifindices(int *indices, int num)
struct net_device *dev; struct net_device *dev;
int i = 0; int i = 0;
rtnl_shlock(); read_lock(&dev_base_lock);
for (dev = dev_base; dev && i < num; dev = dev->next) { for (dev = dev_base; dev && i < num; dev = dev->next) {
if (dev->priv_flags & IFF_EBRIDGE) if (dev->priv_flags & IFF_EBRIDGE)
indices[i++] = dev->ifindex; indices[i++] = dev->ifindex;
} }
rtnl_shunlock(); read_unlock(&dev_base_lock);
return i; return i;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment