diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-04-20 07:36:55 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-04-22 19:06:33 +0200 |
commit | a05381d58b9b67e684146b6f2d5122561666f39a (patch) | |
tree | 8e9a2b8c4c80078deac897a18b16052dd20638cd | |
parent | network/radv: warn about non-zero preference with zero lifetime (diff) | |
download | systemd-a05381d58b9b67e684146b6f2d5122561666f39a.tar.xz systemd-a05381d58b9b67e684146b6f2d5122561666f39a.zip |
network/radv: drop unnecessary conditions
sd_radv_set_xyz() will handle invalid values gracefully.
-rw-r--r-- | src/network/networkd-radv.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index 9ca20e1d51..485178678c 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -542,21 +542,17 @@ static int radv_configure(Link *link) { if (r < 0) return r; - if (link->network->router_lifetime_usec > 0) { - r = sd_radv_set_preference(link->radv, link->network->router_preference); - if (r < 0) - return r; - } + r = sd_radv_set_preference(link->radv, link->network->router_preference); + if (r < 0) + return r; r = sd_radv_set_reachable_time(link->radv, link->network->router_reachable_usec); if (r < 0) return r; - if (link->network->router_retransmit_usec > 0) { - r = sd_radv_set_retransmit(link->radv, link->network->router_retransmit_usec); - if (r < 0) - return r; - } + r = sd_radv_set_retransmit(link->radv, link->network->router_retransmit_usec); + if (r < 0) + return r; HASHMAP_FOREACH(p, link->network->prefixes_by_section) { r = radv_set_prefix(link, p); |