@@ -2301,10 +2301,13 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
23012301 const struct routeinfo * rinfo ;
23022302 const struct ipv6_addr * addr ;
23032303 struct in6_addr netmask ;
2304+ struct timespec now ;
23042305
23052306 if (ctx -> ra_routers == NULL )
23062307 return 0 ;
23072308
2309+ clock_gettime (CLOCK_MONOTONIC , & now );
2310+
23082311 TAILQ_FOREACH (rap , ctx -> ra_routers , next ) {
23092312 if (rap -> expired )
23102313 continue ;
@@ -2325,6 +2328,7 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
23252328#ifdef HAVE_ROUTE_PREF
23262329 rt -> rt_pref = ipv6nd_rtpref (rinfo -> flags );
23272330#endif
2331+ rt -> rt_expires = lifetime_left (rinfo -> lifetime , & rinfo -> acquired , & now );
23282332
23292333 rt_proto_add (routes , rt );
23302334 }
@@ -2339,6 +2343,8 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
23392343#ifdef HAVE_ROUTE_PREF
23402344 rt -> rt_pref = ipv6nd_rtpref (rap -> flags );
23412345#endif
2346+ rt -> rt_expires = lifetime_left (addr -> prefix_vltime , & addr -> acquired , & now );
2347+
23422348 rt_proto_add (routes , rt );
23432349 }
23442350 }
@@ -2370,6 +2376,8 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
23702376#ifdef HAVE_ROUTE_PREF
23712377 rt -> rt_pref = ipv6nd_rtpref (rap -> flags );
23722378#endif
2379+ rt -> rt_expires = lifetime_left (rap -> lifetime , & rap -> acquired , & now );
2380+
23732381 rt_proto_add (routes , rt );
23742382 }
23752383 return 0 ;
0 commit comments