Merge pull request #11232 from yuwata/fix-9130-alternative
network: always check link is ready when address is updated
This commit is contained in:
@@ -351,18 +351,17 @@ int address_update(
|
||||
address->cinfo = *cinfo;
|
||||
|
||||
link_update_operstate(address->link);
|
||||
link_check_ready(address->link);
|
||||
|
||||
if (!ready && address_is_ready(address)) {
|
||||
link_check_ready(address->link);
|
||||
if (!ready &&
|
||||
address_is_ready(address) &&
|
||||
address->family == AF_INET6 &&
|
||||
in_addr_is_link_local(AF_INET6, &address->in_addr) > 0 &&
|
||||
in_addr_is_null(AF_INET6, (const union in_addr_union*) &address->link->ipv6ll_address) > 0) {
|
||||
|
||||
if (address->family == AF_INET6 &&
|
||||
in_addr_is_link_local(AF_INET6, &address->in_addr) > 0 &&
|
||||
in_addr_is_null(AF_INET6, (const union in_addr_union*) &address->link->ipv6ll_address) > 0) {
|
||||
|
||||
r = link_ipv6ll_gained(address->link, &address->in_addr.in6);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
r = link_ipv6ll_gained(address->link, &address->in_addr.in6);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -632,14 +631,10 @@ int address_configure(
|
||||
r = sd_netlink_message_append_in6_addr(req, IFA_ADDRESS, &address->in_addr_peer.in6);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Could not append IFA_ADDRESS attribute: %m");
|
||||
} else {
|
||||
if (address->family == AF_INET) {
|
||||
if (address->prefixlen <= 30) {
|
||||
r = sd_netlink_message_append_in_addr(req, IFA_BROADCAST, &address->broadcast);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Could not append IFA_BROADCAST attribute: %m");
|
||||
}
|
||||
}
|
||||
} else if (address->family == AF_INET && address->prefixlen <= 30) {
|
||||
r = sd_netlink_message_append_in_addr(req, IFA_BROADCAST, &address->broadcast);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Could not append IFA_BROADCAST attribute: %m");
|
||||
}
|
||||
|
||||
if (address->label) {
|
||||
@@ -648,8 +643,7 @@ int address_configure(
|
||||
return log_error_errno(r, "Could not append IFA_LABEL attribute: %m");
|
||||
}
|
||||
|
||||
r = sd_netlink_message_append_cache_info(req, IFA_CACHEINFO,
|
||||
&address->cinfo);
|
||||
r = sd_netlink_message_append_cache_info(req, IFA_CACHEINFO, &address->cinfo);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Could not append IFA_CACHEINFO attribute: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user