]> www.infradead.org Git - users/dwmw2/linux.git/commit
net/ipv6: Fix the RT cache flush via sysctl using a previous delay
authorPetr Pavlu <petr.pavlu@suse.com>
Fri, 7 Jun 2024 11:28:28 +0000 (13:28 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 13 Jun 2024 00:51:35 +0000 (17:51 -0700)
commit14a20e5b4ad998793c5f43b0330d9e1388446cf3
tree83551b4724edbbcfe688e58c4c94264f8aa0a282
parentd92589f8fd551b8e362d7ac09317e01717e1636d
net/ipv6: Fix the RT cache flush via sysctl using a previous delay

The net.ipv6.route.flush system parameter takes a value which specifies
a delay used during the flush operation for aging exception routes. The
written value is however not used in the currently requested flush and
instead utilized only in the next one.

A problem is that ipv6_sysctl_rtcache_flush() first reads the old value
of net->ipv6.sysctl.flush_delay into a local delay variable and then
calls proc_dointvec() which actually updates the sysctl based on the
provided input.

Fix the problem by switching the order of the two operations.

Fixes: 4990509f19e8 ("[NETNS][IPV6]: Make sysctls route per namespace.")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240607112828.30285-1-petr.pavlu@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/route.c