mirror of
https://github.com/systemd/systemd.git
synced 2026-08-10 01:48:09 +00:00
network: fdb - Use hashmap_ensure_put
This commit is contained in:
committed by
Susant Sahani
parent
c75165cade
commit
03d2d9e18f
@@ -79,11 +79,7 @@ static int fdb_entry_new_static(
|
||||
.fdb_ntf_flags = NEIGHBOR_CACHE_ENTRY_FLAGS_SELF,
|
||||
};
|
||||
|
||||
r = hashmap_ensure_allocated(&network->fdb_entries_by_section, &network_config_hash_ops);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = hashmap_put(network->fdb_entries_by_section, fdb_entry->section, fdb_entry);
|
||||
r = hashmap_ensure_put(&network->fdb_entries_by_section, &network_config_hash_ops, fdb_entry->section, fdb_entry);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user