mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 22:35:15 +00:00
netdev: Make netdev_get_devices() take a reference to each netdev.
This API change is necessary for thread safety, to be added in an upcoming commit. Otherwise, the client would not be able to actually use any of the returned netdevs because they could already have been destroyed. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
This commit is contained in:
@@ -555,6 +555,7 @@ netdev_linux_cache_cb(const struct rtnetlink_link_change *change,
|
||||
|
||||
get_flags(&dev->up, &flags);
|
||||
netdev_linux_changed(dev, flags, 0);
|
||||
netdev_close(netdev);
|
||||
}
|
||||
shash_destroy(&device_shash);
|
||||
}
|
||||
@@ -1180,6 +1181,7 @@ netdev_linux_miimon_run(void)
|
||||
bool miimon;
|
||||
|
||||
if (dev->miimon_interval <= 0 || !timer_expired(&dev->miimon_timer)) {
|
||||
netdev_close(netdev);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1190,6 +1192,7 @@ netdev_linux_miimon_run(void)
|
||||
}
|
||||
|
||||
timer_set_duration(&dev->miimon_timer, dev->miimon_interval);
|
||||
netdev_close(netdev);
|
||||
}
|
||||
|
||||
shash_destroy(&device_shash);
|
||||
@@ -1210,6 +1213,7 @@ netdev_linux_miimon_wait(void)
|
||||
if (dev->miimon_interval > 0) {
|
||||
timer_wait(&dev->miimon_timer);
|
||||
}
|
||||
netdev_close(netdev);
|
||||
}
|
||||
shash_destroy(&device_shash);
|
||||
}
|
||||
|
Reference in New Issue
Block a user