From 496db330041151138809c8f8579fa91d7897aabe Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 3 Mar 2021 12:56:52 +0900 Subject: tree-wide: use usec_add() and usec_sub_unsigned() --- src/network/networkd-ndisc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/network/networkd-ndisc.c') diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index bb62ddd93f..035e80dab0 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -535,7 +535,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) { route->pref = preference; route->gw_family = AF_INET6; route->gw = gateway; - route->lifetime = time_now + lifetime * USEC_PER_SEC; + route->lifetime = usec_add(time_now, lifetime * USEC_PER_SEC); route->mtu = mtu; r = ndisc_route_configure(route, link, rt); @@ -559,7 +559,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) { route_gw->protocol = RTPROT_RA; if (!route_gw->pref_set) route->pref = preference; - route_gw->lifetime = time_now + lifetime * USEC_PER_SEC; + route_gw->lifetime = usec_add(time_now, lifetime * USEC_PER_SEC); if (route_gw->mtu == 0) route_gw->mtu = mtu; @@ -818,7 +818,7 @@ static int ndisc_router_process_onlink_prefix(Link *link, sd_ndisc_router *rt) { route->protocol = RTPROT_RA; route->flags = RTM_F_PREFIX; route->dst_prefixlen = prefixlen; - route->lifetime = time_now + lifetime * USEC_PER_SEC; + route->lifetime = usec_add(time_now, lifetime * USEC_PER_SEC); r = sd_ndisc_router_prefix_get_address(rt, &route->dst.in6); if (r < 0) @@ -906,7 +906,7 @@ static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) { route->gw_family = AF_INET6; route->dst = dst; route->dst_prefixlen = prefixlen; - route->lifetime = time_now + lifetime * USEC_PER_SEC; + route->lifetime = usec_add(time_now, lifetime * USEC_PER_SEC); r = ndisc_route_configure(route, link, rt); if (r < 0) -- cgit v1.2.1