diff options
author | Ben Pfaff <blp@nicira.com> | 2013-07-25 17:05:46 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-08-07 23:52:43 -0700 |
commit | 991e5fae57752bc76a63027c5a8ac4a470e0f54f (patch) | |
tree | 2355260c5d8026b84cd2439f6c3e83f4ade690dc /lib/netdev-linux.c | |
parent | 2f980d741737fd3296d8063d800753a2d77bd730 (diff) |
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>
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r-- | lib/netdev-linux.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 5bbaf632..c59f5909 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -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; |