[Bug 289177] IPv6 temp address(es) with pltime=0 briefly loses deprecated on RA → OS may pick the old address as the source

[email protected]
Newsgroups gmane.os.freebsd.devel.net
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289177

Marek Zarychta <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected].
                   |                            |pl

--- Comment #1 from Marek Zarychta <[email protected]> ---
(In reply to Dmitry Nexus from comment #0)
Nice catch, thanks for reporting. While the current mechanism probably deserves
a more thorough rewrite, this simple patch should at least fix the off-by-one
error. Does it resolve the issue for you?

--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -358,11 +358,11 @@ extern const struct in6_addr
in6addr_linklocal_allv2routers;

 #define IFA6_IS_DEPRECATED(a) \
        ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \
-        (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \
+        (u_int32_t)((time_uptime - (a)->ia6_updatetime)) >= \
         (a)->ia6_lifetime.ia6t_pltime)
 #define IFA6_IS_INVALID(a) \
        ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \
-        (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \
+        (u_int32_t)((time_uptime - (a)->ia6_updatetime)) >= \
         (a)->ia6_lifetime.ia6t_vltime)
 #endif /* _KERNEL */

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.