mirror of
https://github.com/systemd/systemd.git
synced 2025-03-08 08:58:27 +03:00
network: simplify the condition about ipv4ll is enabled or not
This commit is contained in:
parent
d19b993983
commit
0b4b66cc53
@ -1052,9 +1052,7 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
|
||||
|
||||
switch (event) {
|
||||
case SD_DHCP_CLIENT_EVENT_STOP:
|
||||
if (link_ipv4ll_enabled(link)) {
|
||||
assert(link->ipv4ll);
|
||||
|
||||
if (link->ipv4ll) {
|
||||
log_link_debug(link, "DHCP client is stopped. Acquiring IPv4 link-local address");
|
||||
|
||||
r = sd_ipv4ll_start(link->ipv4ll);
|
||||
@ -1141,16 +1139,12 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
|
||||
break;
|
||||
|
||||
case SD_DHCP_CLIENT_EVENT_TRANSIENT_FAILURE:
|
||||
if (link_ipv4ll_enabled(link)) {
|
||||
assert(link->ipv4ll);
|
||||
if (link->ipv4ll && !sd_ipv4ll_is_running(link->ipv4ll)) {
|
||||
log_link_debug(link, "Problems acquiring DHCP lease, acquiring IPv4 link-local address");
|
||||
|
||||
if (!sd_ipv4ll_is_running(link->ipv4ll)) {
|
||||
log_link_debug(link, "Problems acquiring DHCP lease, acquiring IPv4 link-local address");
|
||||
|
||||
r = sd_ipv4ll_start(link->ipv4ll);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Could not acquire IPv4 link-local address: %m");
|
||||
}
|
||||
r = sd_ipv4ll_start(link->ipv4ll);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Could not acquire IPv4 link-local address: %m");
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1207,9 +1207,7 @@ static int link_acquire_ipv4_conf(Link *link) {
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Could not acquire DHCPv4 lease: %m");
|
||||
|
||||
} else if (link_ipv4ll_enabled(link)) {
|
||||
assert(link->ipv4ll);
|
||||
|
||||
} else if (link->ipv4ll) {
|
||||
log_link_debug(link, "Acquiring IPv4 link-local address");
|
||||
|
||||
r = sd_ipv4ll_start(link->ipv4ll);
|
||||
|
Loading…
x
Reference in New Issue
Block a user