2
0
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:
Ben Pfaff
2013-07-25 17:05:46 -07:00
parent 2f980d7417
commit 991e5fae57
2 changed files with 14 additions and 4 deletions

View File

@@ -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;