]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: fib_nexthops: test stale has_v4 on nexthop replace
authorJiayuan Chen <jiayuan.chen@linux.dev>
Mon, 13 Apr 2026 11:45:20 +0000 (19:45 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 16 Apr 2026 11:48:30 +0000 (13:48 +0200)
commit104f082f5ed6d19c5d85ca905ccd4e4d01aef66e
tree26dcbf0472ec884e9b8a53c597bb1086002190ff
parent29c95185ba32b621fbc3800fb86e7dc3edf5c2be
selftests: fib_nexthops: test stale has_v4 on nexthop replace

Add test cases that exercise the scenario where an IPv6 nexthop is
replaced with an IPv4 nexthop while being part of a group. The group's
has_v4 flag must be updated so that subsequent IPv6 route additions are
properly rejected.

Two cases are covered:
  1. Gateway nexthop replaced across families with an existing IPv6
     route on the group (rejected by fib6_check_nh_list).
  2. Blackhole nexthop replaced across families with no existing IPv6
     route on the group (fib6_check_nh_list returns early) — this is
     the path that triggers a NULL ptr deref without the kernel fix.

Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260413114522.147784-2-jiayuan.chen@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/fib_nexthops.sh