Page MenuHomeFreeBSD

ip6: fix off-by-one in pltime and vltime expiration checks
ClosedPublic

Authored by zarychtam_plan-b.pwste.edu.pl on Sep 1 2025, 5:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 2, 6:58 PM
Unknown Object (File)
Tue, Dec 2, 12:50 PM
Unknown Object (File)
Wed, Nov 26, 5:42 AM
Unknown Object (File)
Nov 2 2025, 11:37 PM
Unknown Object (File)
Oct 29 2025, 2:29 AM
Unknown Object (File)
Oct 26 2025, 5:00 PM
Unknown Object (File)
Oct 24 2025, 5:06 AM
Unknown Object (File)
Oct 20 2025, 12:50 AM

Details

Summary

Fix an off-by-one error in IFA6_IS_DEPRECATED() and IFA6_IS_INVALID().

Previously, the macros used '>' instead of '>=' when comparing elapsed
time against the preferred and valid lifetimes. This caused any deprecated
address to become usable again for one extra second after receiving each
Router Advertisement. In that short window, the address could be
selected as a source for outgoing connections.

Update the checks to use '>=' so that addresses are deprecated or
invalid when their lifetime expires.

PR: 289177
Reported by: Dmitry Nexus <fbsd.4f6a@nexus.tel>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sep 2 2025, 9:27 AM
zlei added a subscriber: zlei.

Looks good to me.

To simplify the evaluation if the if addr is deprecated or invalid, just think of 0 value of ia6t_pltime and ia6t_vltime . A 0 life time means the addr immediately reach EoL.