mirror of
https://github.com/systemd/systemd.git
synced 2025-01-25 10:04:04 +03:00
network: drop unnecessary conditions
sd_ipv4acd_stop() and sd_ipv4ll_stop() are idempotent.
This commit is contained in:
parent
c6a7531e0e
commit
a391901eb2
@ -1402,11 +1402,9 @@ static int ipv4_dad_update_mac_one(Address *address) {
|
||||
|
||||
running = sd_ipv4acd_is_running(address->acd);
|
||||
|
||||
if (running) {
|
||||
r = sd_ipv4acd_stop(address->acd);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
r = sd_ipv4acd_stop(address->acd);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_ipv4acd_set_mac(address->acd, &address->link->mac);
|
||||
if (r < 0)
|
||||
|
@ -207,11 +207,9 @@ int ipv4ll_update_mac(Link *link) {
|
||||
|
||||
restart = sd_ipv4ll_is_running(link->ipv4ll) > 0;
|
||||
|
||||
if (restart) {
|
||||
r = sd_ipv4ll_stop(link->ipv4ll);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
r = sd_ipv4ll_stop(link->ipv4ll);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_ipv4ll_set_mac(link->ipv4ll, &link->mac);
|
||||
if (r < 0)
|
||||
|
@ -697,11 +697,9 @@ int radv_update_mac(Link *link) {
|
||||
|
||||
restart = sd_radv_is_running(link->radv);
|
||||
|
||||
if (restart) {
|
||||
r = sd_radv_stop(link->radv);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
r = sd_radv_stop(link->radv);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_radv_set_mac(link->radv, &link->mac);
|
||||
if (r < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user