1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

network: ndisc - Use ordered_set_ensure_put

This commit is contained in:
Susant Sahani 2021-01-20 12:56:44 +01:00
parent 32ae5db60a
commit 9b1fd1f55b

View File

@ -1544,11 +1544,9 @@ int config_parse_address_generation_type(
token->prefix = buffer.in6; token->prefix = buffer.in6;
} }
r = ordered_set_ensure_allocated(&network->ipv6_tokens, &ipv6_token_hash_ops); r = ordered_set_ensure_put(&network->ipv6_tokens, &ipv6_token_hash_ops, token);
if (r < 0) if (r == -ENOMEM)
return log_oom(); return log_oom();
r = ordered_set_put(network->ipv6_tokens, token);
if (r == -EEXIST) if (r == -EEXIST)
log_syntax(unit, LOG_DEBUG, filename, line, r, log_syntax(unit, LOG_DEBUG, filename, line, r,
"IPv6 token '%s' is duplicated, ignoring: %m", rvalue); "IPv6 token '%s' is duplicated, ignoring: %m", rvalue);