network: ndisc - Use ordered_set_ensure_put

This commit is contained in:
Susant Sahani
2021-01-20 15:09:14 +01:00
parent 32ae5db60a
commit 9b1fd1f55b
+2 -4
View File
@@ -1544,11 +1544,9 @@ int config_parse_address_generation_type(
token->prefix = buffer.in6;
}
r = ordered_set_ensure_allocated(&network->ipv6_tokens, &ipv6_token_hash_ops);
if (r < 0)
r = ordered_set_ensure_put(&network->ipv6_tokens, &ipv6_token_hash_ops, token);
if (r == -ENOMEM)
return log_oom();
r = ordered_set_put(network->ipv6_tokens, token);
if (r == -EEXIST)
log_syntax(unit, LOG_DEBUG, filename, line, r,
"IPv6 token '%s' is duplicated, ignoring: %m", rvalue);