Re: [PATCH net v4] ipv6: fib6_rules: flush route cache when rule is changed
From: David Ahern
Date: Fri Mar 01 2024 - 10:27:53 EST
On 3/1/24 7:39 AM, Lena Wang (王娜) wrote:
> From: Shiming Cheng <shiming.cheng@xxxxxxxxxxxx>
>
> When rule policy is changed, ipv6 socket cache is not refreshed.
> The sock's skb still uses a outdated route cache and was sent to
> a wrong interface.
>
> To avoid this error we should update fib node's version when
> rule is changed. Then skb's route will be reroute checked as
> route cache version is already different with fib node version.
> The route cache is refreshed to match the latest rule.
>
> Fixes: 101367c2f8c4 ("[IPV6]: Policy Routing Rules")
> Signed-off-by: Shiming Cheng <shiming.cheng@xxxxxxxxxxxx>
> Signed-off-by: Lena Wang <lena.wang@xxxxxxxxxxxx>
> ---
> v4:
> - add "Fixes:" tag.
> - update subject as requested.
> v3:
> - update patch description and name format in commit message.
> v2:
> - modify flush function same way as ipv4 flush cache.
> - use tabs to aligh with existing code.
> ---
> ---
> net/ipv6/fib6_rules.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>