summaryrefslogtreecommitdiff
path: root/src/network/networkd-ndisc.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-03 12:56:52 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-03-05 07:10:08 +0900
commit496db330041151138809c8f8579fa91d7897aabe (patch)
tree865ff3fde1989e4bf931da2563dfd3315401f3e9 /src/network/networkd-ndisc.c
parente6283cbf48a3821d03ec73252620fc1b04bd4588 (diff)
downloadsystemd-496db330041151138809c8f8579fa91d7897aabe.tar.gz
tree-wide: use usec_add() and usec_sub_unsigned()
Diffstat (limited to 'src/network/networkd-ndisc.c')
-rw-r--r--src/network/networkd-ndisc.c8
1 files changed, 4 insertions, 4 deletions
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)