summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2021-01-14 06:25:12 +0100
committerSusant Sahani <ssahani@gmail.com>2021-01-15 14:29:42 +0100
commitb77071b8989bd7859804087711fa37ca23b0027b (patch)
tree890b7585388e946b00da161fa62b43cf7b7e788f /src/network
parentc26f9a9d8cdc2a9f0dd78bec89ea97505eedda7e (diff)
downloadsystemd-b77071b8989bd7859804087711fa37ca23b0027b.tar.gz
network: wireguard - Use hashmap_ensure_put
Diffstat (limited to 'src/network')
-rw-r--r--src/network/netdev/wireguard.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
index 76444bdd7c..e442ecc266 100644
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -91,11 +91,7 @@ static int wireguard_peer_new_static(Wireguard *w, const char *filename, unsigne
LIST_PREPEND(peers, w->peers, peer);
- r = hashmap_ensure_allocated(&w->peers_by_section, &network_config_hash_ops);
- if (r < 0)
- return r;
-
- r = hashmap_put(w->peers_by_section, peer->section, peer);
+ r = hashmap_ensure_put(&w->peers_by_section, &network_config_hash_ops, peer->section, peer);
if (r < 0)
return r;