diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-02-07 22:11:23 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-02-07 22:24:31 +0100 |
commit | b409ac6c77ca49dfd09fea7cf1ad04e0a58ad934 (patch) | |
tree | 4d85cf74a0034835101783fc12126b70a7271987 /src/network/networkd-ndisc.c | |
parent | network/ndisc: slightly adjust log messages (diff) | |
download | systemd-b409ac6c77ca49dfd09fea7cf1ad04e0a58ad934.tar.xz systemd-b409ac6c77ca49dfd09fea7cf1ad04e0a58ad934.zip |
network/ndisc: sd_ndisc_router_get_{icmp6_ratelimit,retransmission_time}() should never fail
This also fixes use of '%m' specifier without passign error code.
Diffstat (limited to '')
-rw-r--r-- | src/network/networkd-ndisc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 13b09e9978..50ee376223 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -372,10 +372,8 @@ static int ndisc_router_process_icmp6_ratelimit(Link *link, sd_ndisc_router *rt) return 0; r = sd_ndisc_router_get_icmp6_ratelimit(rt, &icmp6_ratelimit); - if (r < 0) { - log_link_debug(link, "Failed to get ICMP6 ratelimit from RA, ignoring: %m"); - return 0; - } + if (r < 0) + return log_link_warning_errno(link, r, "Failed to get ICMP6 ratelimit from RA: %m"); /* We do not allow 0 here. */ if (!timestamp_is_set(icmp6_ratelimit)) @@ -406,10 +404,8 @@ static int ndisc_router_process_retransmission_time(Link *link, sd_ndisc_router return 0; r = sd_ndisc_router_get_retransmission_time(rt, &retrans_time); - if (r < 0) { - log_link_debug_errno(link, r, "Failed to get retransmission time from RA, ignoring: %m"); - return 0; - } + if (r < 0) + return log_link_warning_errno(link, r, "Failed to get retransmission time from RA: %m"); /* 0 is the unspecified value and must not be set (see RFC4861, 6.3.4) */ if (!timestamp_is_set(retrans_time)) |