mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
network: ndisc: update a log message
Also slightly rename functions.
This commit is contained in:
@@ -619,7 +619,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool stableprivate_address_is_valid(const struct in6_addr *addr) {
|
||||
static bool stable_private_address_is_valid(const struct in6_addr *addr) {
|
||||
assert(addr);
|
||||
|
||||
/* According to rfc4291, generated address should not be in the following ranges. */
|
||||
@@ -636,7 +636,7 @@ static bool stableprivate_address_is_valid(const struct in6_addr *addr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static int make_stableprivate_address(Link *link, const struct in6_addr *prefix, uint8_t prefix_len, uint8_t dad_counter, struct in6_addr **ret) {
|
||||
static int make_stable_private_address(Link *link, const struct in6_addr *prefix, uint8_t prefix_len, uint8_t dad_counter, struct in6_addr **ret) {
|
||||
_cleanup_free_ struct in6_addr *addr = NULL;
|
||||
sd_id128_t secret_key;
|
||||
struct siphash state;
|
||||
@@ -649,7 +649,7 @@ static int make_stableprivate_address(Link *link, const struct in6_addr *prefix,
|
||||
|
||||
r = sd_id128_get_machine_app_specific(NDISC_APP_ID, &secret_key);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to generate key: %m");
|
||||
return log_link_warning_errno(link, r, "Failed to generate key for IPv6 stable private address: %m");
|
||||
|
||||
siphash24_init(&state, secret_key.bytes);
|
||||
|
||||
@@ -672,7 +672,7 @@ static int make_stableprivate_address(Link *link, const struct in6_addr *prefix,
|
||||
memcpy(addr->s6_addr, prefix->s6_addr, l);
|
||||
memcpy(addr->s6_addr + l, &rid, 16 - l);
|
||||
|
||||
if (!stableprivate_address_is_valid(addr)) {
|
||||
if (!stable_private_address_is_valid(addr)) {
|
||||
*ret = NULL;
|
||||
return 0;
|
||||
}
|
||||
@@ -704,7 +704,7 @@ static int ndisc_router_generate_addresses(Link *link, struct in6_addr *address,
|
||||
* only when the address generation algorithm produces an invalid address, and the loop
|
||||
* may exit with an address which ends up being unusable due to duplication on the link. */
|
||||
for (; j->dad_counter < DAD_CONFLICTS_IDGEN_RETRIES_RFC7217; j->dad_counter++) {
|
||||
r = make_stableprivate_address(link, address, prefixlen, j->dad_counter, &new_address);
|
||||
r = make_stable_private_address(link, address, prefixlen, j->dad_counter, &new_address);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r > 0)
|
||||
|
||||
Reference in New Issue
Block a user