mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
netdev: Make netdev_from_name() take a reference to its returned netdev.
This API change is necessary for thread safety, to be added in an upcoming commit. Otherwise, the client would not be able to safely use the returned netdev because it 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:
@@ -541,6 +541,7 @@ netdev_linux_cache_cb(const struct rtnetlink_link_change *change,
|
||||
struct netdev *base_dev = netdev_from_name(change->ifname);
|
||||
if (base_dev && is_netdev_linux_class(netdev_get_class(base_dev))) {
|
||||
netdev_linux_update(netdev_linux_cast(base_dev), change);
|
||||
netdev_close(base_dev);
|
||||
}
|
||||
} else {
|
||||
struct shash device_shash;
|
||||
|
Reference in New Issue
Block a user