Skip to content

Commit

Permalink
network/ndisc: sd_ndisc_router_get_{icmp6_ratelimit,retransmission_ti…
Browse files Browse the repository at this point in the history
…me}() should never fail

This also fixes use of '%m' specifier without passign error code.
  • Loading branch information
yuwata committed Feb 7, 2024
1 parent 34acdf9 commit b409ac6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/network/networkd-ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit b409ac6

Please sign in to comment.