diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-02-27 11:31:26 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-02-28 12:05:00 +0100 |
commit | 39af486a7fdc67817652c51d9bf42ca051ed8ff2 (patch) | |
tree | 19756ecd35afe789d4c386228345ec961b921831 /src/network/networkd-ndisc.c | |
parent | nspawn: minor coding style tweaks to nspawn-register.c (diff) | |
download | systemd-39af486a7fdc67817652c51d9bf42ca051ed8ff2.tar.xz systemd-39af486a7fdc67817652c51d9bf42ca051ed8ff2.zip |
network/ndisc: drop redundant sd_ndisc_router_get_icmp6_ratelimit()
This effectively reverts 9175002864d8876f375e0df089d142d239282528.
The retrans time field in RA message is for neighbor solicitation,
and the commit d4c8de21a07d015f2f2c787e0735be5e4d02fb3c makes the value
assigned to the correct sysctl property.
Let's deprecate the option, and drop the redundant functions.
Diffstat (limited to 'src/network/networkd-ndisc.c')
-rw-r--r-- | src/network/networkd-ndisc.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 24808413c1..33bd7335a1 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -512,43 +512,6 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) { return 0; } -static int ndisc_router_process_icmp6_ratelimit(Link *link, sd_ndisc_router *rt) { - usec_t icmp6_ratelimit, msec; - int r; - - assert(link); - assert(link->network); - assert(rt); - - if (!link->network->ndisc_use_icmp6_ratelimit) - return 0; - - /* Ignore the icmp6 ratelimit field of the RA header if the lifetime is zero. */ - r = sd_ndisc_router_get_lifetime(rt, NULL); - if (r <= 0) - return r; - - r = sd_ndisc_router_get_icmp6_ratelimit(rt, &icmp6_ratelimit); - 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)) - return 0; - - msec = DIV_ROUND_UP(icmp6_ratelimit, USEC_PER_MSEC); - if (msec <= 0 || msec > INT_MAX) - return 0; - - /* Limit the maximal rates for sending ICMPv6 packets. 0 to disable any limiting, otherwise the - * minimal space between responses in milliseconds. Default: 1000. */ - r = sysctl_write_ip_property_int(AF_INET6, NULL, "icmp/ratelimit", (int) msec); - if (r < 0) - log_link_warning_errno(link, r, "Failed to apply ICMP6 ratelimit, ignoring: %m"); - - return 0; -} - static int ndisc_router_process_reachable_time(Link *link, sd_ndisc_router *rt) { usec_t reachable_time, msec; int r; @@ -1699,10 +1662,6 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) { if (r < 0) return r; - r = ndisc_router_process_icmp6_ratelimit(link, rt); - if (r < 0) - return r; - r = ndisc_router_process_reachable_time(link, rt); if (r < 0) return r; |