Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,10 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
const struct routeinfo *rinfo;
const struct ipv6_addr *addr;
struct in6_addr netmask;
struct timespec now;
uint32_t elapsed;

clock_gettime(CLOCK_MONOTONIC, &now);

if (ctx->ra_routers == NULL)
return 0;
Expand All @@ -2325,6 +2329,8 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
#ifdef HAVE_ROUTE_PREF
rt->rt_pref = ipv6nd_rtpref(rinfo->flags);
#endif
elapsed = (uint32_t)eloop_timespec_diff(&now, &rap->acquired, NULL);
rt->rt_expires = rap->lifetime - elapsed;

rt_proto_add(routes, rt);
}
Expand All @@ -2339,6 +2345,9 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
#ifdef HAVE_ROUTE_PREF
rt->rt_pref = ipv6nd_rtpref(rap->flags);
#endif
elapsed = (uint32_t)eloop_timespec_diff(&now, &rap->acquired, NULL);
rt->rt_expires = rap->lifetime - elapsed;

rt_proto_add(routes, rt);
}
}
Expand Down Expand Up @@ -2370,7 +2379,8 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
#ifdef HAVE_ROUTE_PREF
rt->rt_pref = ipv6nd_rtpref(rap->flags);
#endif
rt->rt_expires = rap->lifetime;
elapsed = (uint32_t)eloop_timespec_diff(&now, &rap->acquired, NULL);
rt->rt_expires = rap->lifetime - elapsed;

rt_proto_add(routes, rt);
}
Expand Down
Loading