Neighbor Advertisements for existing NUD_FAILED entries are currently ignored. This can leave a first-hop router with an unusable neighbor after the host becomes reachable and announces itself, particularly when forwarding is offloaded away from the kernel and traffic destined to the FAILED neighbor is unable to trigger the kernel's normal neighbor resolution process. Allowing neighbor entries to be updated from NAs already received by the kernel is preferable since it creates less work compared to periodically probing FAILED neighbors (e.g. using NTF_EXT_MANAGED).
Extend accept_untracked_na to treat FAILED entries like absent entries. Require a target link-layer address, IPv6 forwarding, and acceptance by the sysctl, including its source-prefix check in mode 2. Recover the entry only to STALE, including for solicited NAs, to maintain parity with handling of non-existent neighbor cache entries. Patch #1 implements the behavior and updates RFC 9131-related comments and accept_untracked_na documentation. Patch #2 extends ndisc_unsolicited_na_test.sh to cover FAILED-entry recovery and each acceptance gate, including in-prefix and out-of-prefix mode 2. Thanks to Ido Schimmel for feedback on the original RFC. --- v2: - Full implementation of logic to update FAILED entries to STALE. - Update the RFC 9131-related comments and sysctl documentation. - Add selftests to verify state changes only when the accept_untracked_na setting is enabled. v1 (RFC): https://lore.kernel.org/r/[email protected] Testing: - x86_64 current-config and allyesconfig builds with W=1 - tools/testing/selftests/net/ndisc_unsolicited_na_test.sh: 14 passed - Local NIPA checks: all substantive checks passed - Sashiko local review completed Lawrence Lee (2): ipv6: update NUD_FAILED neighbors from NA messages selftests: net: test untracked NA recovery of FAILED neighbors Documentation/networking/ip-sysctl.rst | 28 ++-- include/net/ndisc.h | 15 ++- net/6lowpan/ndisc.c | 15 ++- net/ipv6/ndisc.c | 94 ++++++++----- .../net/ndisc_unsolicited_na_test.sh | 124 +++++++++++++++--- 5 files changed, 201 insertions(+), 75 deletions(-) base-commit: 272a65db243bfa34b9277632830e0e06d7e3518e -- 2.43.0

