- netdev->cache = shash_find_data(&cache_map, name);
- if (!netdev->cache) {
- if (shash_is_empty(&cache_map)) {
- int error = rtnetlink_notifier_register(
- &netdev_linux_cache_notifier, netdev_linux_cache_cb, NULL);
- if (error) {
- netdev_close(&netdev->netdev);
- return error;
- }
- }
- netdev->cache = xmalloc(sizeof *netdev->cache);
- netdev->cache->shash_node = shash_add(&cache_map, name,
- netdev->cache);
- netdev->cache->valid = 0;
- netdev->cache->ref_cnt = 0;
- }
- netdev->cache->ref_cnt++;