summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-06-24 07:47:55 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-06-24 07:47:55 +0000
commit319451a2d41604cd35b4eec1f35f4d481914632b (patch)
tree2884d9be029dc1cd603500d7ac860baf8076a90f
parentec5b565276d3b8c473a6d06eca4d669e9e943e31 (diff)
use time.tv_sec directly, rather than having time_second (freebsd NIH).
-rw-r--r--sys/netinet6/icmp6.c7
-rw-r--r--sys/netinet6/in6.c20
-rw-r--r--sys/netinet6/ip6_forward.c11
-rw-r--r--sys/netinet6/ip6_mroute.c7
-rw-r--r--sys/netinet6/nd6.c39
-rw-r--r--sys/netinet6/nd6_nbr.c13
-rw-r--r--sys/netinet6/nd6_rtr.c25
7 files changed, 53 insertions, 69 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index c34c599adf3..ba3b6a4daac 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.71 2003/06/11 02:54:02 itojun Exp $ */
+/* $OpenBSD: icmp6.c,v 1.72 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1753,7 +1753,6 @@ ni6_store_addrs(ni6, nni6, ifp0, resid)
u_char *cp = (u_char *)(nni6 + 1);
int niflags = ni6->ni_flags;
u_int32_t ltime;
- long time_second = time.tv_sec;
if (ifp0 == NULL && !(niflags & NI_NODEADDR_FLAG_ALL))
return (0); /* needless to copy */
@@ -1845,8 +1844,8 @@ ni6_store_addrs(ni6, nni6, ifp0, resid)
ltime = ND6_INFINITE_LIFETIME;
else {
if (ifa6->ia6_lifetime.ia6t_expire >
- time_second)
- ltime = htonl(ifa6->ia6_lifetime.ia6t_expire - time_second);
+ time.tv_sec)
+ ltime = htonl(ifa6->ia6_lifetime.ia6t_expire - time.tv_sec);
else
ltime = 0;
}
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index a83c88ade0a..450765934bb 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.50 2003/06/02 23:28:15 millert Exp $ */
+/* $OpenBSD: in6.c,v 1.51 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@@ -353,7 +353,6 @@ in6_control(so, cmd, data, ifp, p)
struct in6_ifaddr *ia = NULL;
struct in6_aliasreq *ifra = (struct in6_aliasreq *)data;
struct sockaddr_in6 *sa6;
- time_t time_second = (time_t)time.tv_sec;
int privileged;
privileged = 0;
@@ -527,11 +526,11 @@ in6_control(so, cmd, data, ifp, p)
/* sanity for overflow - beware unsigned */
lt = &ifr->ifr_ifru.ifru_lifetime;
if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME
- && lt->ia6t_vltime + time_second < time_second) {
+ && lt->ia6t_vltime + time.tv_sec < time.tv_sec) {
return EINVAL;
}
if (lt->ia6t_pltime != ND6_INFINITE_LIFETIME
- && lt->ia6t_pltime + time_second < time_second) {
+ && lt->ia6t_pltime + time.tv_sec < time.tv_sec) {
return EINVAL;
}
break;
@@ -625,12 +624,12 @@ in6_control(so, cmd, data, ifp, p)
/* for sanity */
if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
ia->ia6_lifetime.ia6t_expire =
- time_second + ia->ia6_lifetime.ia6t_vltime;
+ time.tv_sec + ia->ia6_lifetime.ia6t_vltime;
} else
ia->ia6_lifetime.ia6t_expire = 0;
if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
ia->ia6_lifetime.ia6t_preferred =
- time_second + ia->ia6_lifetime.ia6t_pltime;
+ time.tv_sec + ia->ia6_lifetime.ia6t_pltime;
} else
ia->ia6_lifetime.ia6t_preferred = 0;
break;
@@ -796,7 +795,6 @@ in6_update_ifa(ifp, ifra, ia)
struct sockaddr_in6 dst6;
struct in6_addrlifetime *lt;
struct in6_multi_mship *imm;
- time_t time_second = (time_t)time.tv_sec;
struct rtentry *rt;
/* Validate parameters */
@@ -936,7 +934,7 @@ in6_update_ifa(ifp, ifra, ia)
ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
ia->ia_addr.sin6_family = AF_INET6;
ia->ia_addr.sin6_len = sizeof(ia->ia_addr);
- ia->ia6_createtime = ia->ia6_updatetime = time_second;
+ ia->ia6_createtime = ia->ia6_updatetime = time.tv_sec;
if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) != 0) {
/*
* XXX: some functions expect that ifa_dstaddr is not
@@ -1008,12 +1006,12 @@ in6_update_ifa(ifp, ifra, ia)
ia->ia6_lifetime = ifra->ifra_lifetime;
if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
ia->ia6_lifetime.ia6t_expire =
- time_second + ia->ia6_lifetime.ia6t_vltime;
+ time.tv_sec + ia->ia6_lifetime.ia6t_vltime;
} else
ia->ia6_lifetime.ia6t_expire = 0;
if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
ia->ia6_lifetime.ia6t_preferred =
- time_second + ia->ia6_lifetime.ia6t_pltime;
+ time.tv_sec + ia->ia6_lifetime.ia6t_pltime;
} else
ia->ia6_lifetime.ia6t_preferred = 0;
@@ -1031,7 +1029,7 @@ in6_update_ifa(ifp, ifra, ia)
*/
if ((ifra->ifra_flags & IN6_IFF_DEPRECATED) != 0) {
ia->ia6_lifetime.ia6t_pltime = 0;
- ia->ia6_lifetime.ia6t_preferred = time_second;
+ ia->ia6_lifetime.ia6t_preferred = time.tv_sec;
}
/*
* Make the address tentative before joining multicast addresses,
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index a641e694be6..17b2c5f7e22 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_forward.c,v 1.25 2003/05/15 05:37:39 todd Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.26 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
@@ -92,7 +92,6 @@ ip6_forward(m, srcrt)
struct rtentry *rt;
int error, type = 0, code = 0;
struct mbuf *mcopy = NULL;
- long time_second = time.tv_sec;
struct ifnet *origifp; /* maybe unnecessary */
#ifdef IPSEC
u_int8_t sproto = 0;
@@ -115,8 +114,8 @@ ip6_forward(m, srcrt)
IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) {
ip6stat.ip6s_cantforward++;
/* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */
- if (ip6_log_time + ip6_log_interval < time_second) {
- ip6_log_time = time_second;
+ if (ip6_log_time + ip6_log_interval < time.tv_sec) {
+ ip6_log_time = time.tv_sec;
log(LOG_DEBUG,
"cannot forward "
"from %s to %s nxt %d received on %s\n",
@@ -289,8 +288,8 @@ ip6_forward(m, srcrt)
ip6stat.ip6s_badscope++;
in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard);
- if (ip6_log_time + ip6_log_interval < time_second) {
- ip6_log_time = time_second;
+ if (ip6_log_time + ip6_log_interval < time.tv_sec) {
+ ip6_log_time = time.tv_sec;
log(LOG_DEBUG,
"cannot forward "
"src %s, dst %s, nxt %d, rcvif %s, outif %s\n",
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 9bacf231f2a..af856a02e63 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_mroute.c,v 1.38 2003/06/06 06:57:23 itojun Exp $ */
+/* $OpenBSD: ip6_mroute.c,v 1.39 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */
/*
@@ -963,7 +963,6 @@ ip6_mforward(ip6, ifp, m)
struct mbuf *mm;
int s;
mifi_t mifi;
- long time_second = time.tv_sec;
#ifdef MRT6DEBUG
if (mrt6debug & DEBUG_FORWARD)
@@ -990,8 +989,8 @@ ip6_mforward(ip6, ifp, m)
*/
if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) {
ip6stat.ip6s_cantforward++;
- if (ip6_log_time + ip6_log_interval < time_second) {
- ip6_log_time = time_second;
+ if (ip6_log_time + ip6_log_interval < time.tv_sec) {
+ ip6_log_time = time.tv_sec;
log(LOG_DEBUG,
"cannot forward "
"from %s to %s nxt %d received on %s\n",
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index d56131df6f2..321456b00c5 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.61 2003/06/24 07:31:50 itojun Exp $ */
+/* $OpenBSD: nd6.c,v 1.62 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -375,7 +375,6 @@ nd6_timer(ignored_arg)
struct llinfo_nd6 *ln;
struct nd_defrouter *dr;
struct nd_prefix *pr;
- long time_second = time.tv_sec;
struct ifnet *ifp;
struct in6_ifaddr *ia6, *nia6;
struct in6_addrlifetime *lt6;
@@ -403,7 +402,7 @@ nd6_timer(ignored_arg)
ndi = ND_IFINFO(ifp);
dst = (struct sockaddr_in6 *)rt_key(rt);
- if (ln->ln_expire > time_second) {
+ if (ln->ln_expire > time.tv_sec) {
ln = next;
continue;
}
@@ -421,7 +420,7 @@ nd6_timer(ignored_arg)
case ND6_LLINFO_INCOMPLETE:
if (ln->ln_asked < nd6_mmaxtries) {
ln->ln_asked++;
- ln->ln_expire = time_second +
+ ln->ln_expire = time.tv_sec +
ND6_RETRANS_SEC(ND_IFINFO(ifp)->retrans);
nd6_ns_output(ifp, NULL, &dst->sin6_addr,
ln, 0);
@@ -447,7 +446,7 @@ nd6_timer(ignored_arg)
case ND6_LLINFO_REACHABLE:
if (ln->ln_expire) {
ln->ln_state = ND6_LLINFO_STALE;
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
}
break;
@@ -462,19 +461,19 @@ nd6_timer(ignored_arg)
/* We need NUD */
ln->ln_asked = 1;
ln->ln_state = ND6_LLINFO_PROBE;
- ln->ln_expire = time_second +
+ ln->ln_expire = time.tv_sec +
ND6_RETRANS_SEC(ndi->retrans);
nd6_ns_output(ifp, &dst->sin6_addr,
&dst->sin6_addr, ln, 0);
} else {
ln->ln_state = ND6_LLINFO_STALE; /* XXX */
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
}
break;
case ND6_LLINFO_PROBE:
if (ln->ln_asked < nd6_umaxtries) {
ln->ln_asked++;
- ln->ln_expire = time_second +
+ ln->ln_expire = time.tv_sec +
ND6_RETRANS_SEC(ND_IFINFO(ifp)->retrans);
nd6_ns_output(ifp, &dst->sin6_addr,
&dst->sin6_addr, ln, 0);
@@ -489,7 +488,7 @@ nd6_timer(ignored_arg)
/* expire default router list */
dr = TAILQ_FIRST(&nd_defrouter);
while (dr) {
- if (dr->expire && dr->expire < time_second) {
+ if (dr->expire && dr->expire < time.tv_sec) {
struct nd_defrouter *t;
t = TAILQ_NEXT(dr, dr_entry);
defrtrlist_del(dr);
@@ -532,7 +531,7 @@ nd6_timer(ignored_arg)
* prefix is not necessary.
*/
if (pr->ndpr_vltime != ND6_INFINITE_LIFETIME &&
- time_second - pr->ndpr_lastupdate > pr->ndpr_vltime) {
+ time.tv_sec - pr->ndpr_lastupdate > pr->ndpr_vltime) {
struct nd_prefix *t;
t = pr->ndpr_next;
@@ -906,7 +905,6 @@ nd6_nud_hint(rt, dst6, force)
int force;
{
struct llinfo_nd6 *ln;
- long time_second = time.tv_sec;
/*
* If the caller specified "rt", use that. Otherwise, resolve the
@@ -943,7 +941,7 @@ nd6_nud_hint(rt, dst6, force)
ln->ln_state = ND6_LLINFO_REACHABLE;
if (ln->ln_expire)
- ln->ln_expire = time_second + ND_IFINFO(rt->rt_ifp)->reachable;
+ ln->ln_expire = time.tv_sec + ND_IFINFO(rt->rt_ifp)->reachable;
}
void
@@ -957,7 +955,6 @@ nd6_rtrequest(req, rt, info)
static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
struct ifnet *ifp = rt->rt_ifp;
struct ifaddr *ifa;
- long time_second = time.tv_sec;
int mine = 0;
if ((rt->rt_flags & RTF_GATEWAY) != 0)
@@ -1017,7 +1014,7 @@ nd6_rtrequest(req, rt, info)
SDL(gate)->sdl_type = ifp->if_type;
SDL(gate)->sdl_index = ifp->if_index;
if (ln)
- ln->ln_expire = time_second;
+ ln->ln_expire = time.tv_sec;
#if 1
if (ln && ln->ln_expire == 0) {
/* kludge for desktops */
@@ -1106,7 +1103,7 @@ nd6_rtrequest(req, rt, info)
* initialized in rtrequest(), so rt_expire is 0.
*/
ln->ln_state = ND6_LLINFO_NOSTATE;
- ln->ln_expire = time_second;
+ ln->ln_expire = time.tv_sec;
}
rt->rt_flags |= RTF_LLINFO;
ln->ln_next = llinfo_nd6.ln_next;
@@ -1437,7 +1434,6 @@ nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code)
int olladdr;
int llchange;
int newstate = 0;
- long time_second = time.tv_sec;
if (!ifp)
panic("ifp == NULL in nd6_cache_lladdr");
@@ -1548,7 +1544,7 @@ fail:
* we must set the timer now, although it is actually
* meaningless.
*/
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
if (ln->ln_hold) {
/*
@@ -1561,7 +1557,7 @@ fail:
}
} else if (ln->ln_state == ND6_LLINFO_INCOMPLETE) {
/* probe right away */
- ln->ln_expire = time_second;
+ ln->ln_expire = time.tv_sec;
}
}
@@ -1693,7 +1689,6 @@ nd6_output(ifp, origifp, m0, dst, rt0)
struct sockaddr_in6 *gw6 = NULL;
struct llinfo_nd6 *ln = NULL;
int error = 0;
- long time_second = time.tv_sec;
#ifdef IPSEC
struct m_tag *mtag;
#endif /* IPSEC */
@@ -1795,7 +1790,7 @@ nd6_output(ifp, origifp, m0, dst, rt0)
if ((ifp->if_flags & IFF_POINTOPOINT) != 0 &&
ln->ln_state < ND6_LLINFO_REACHABLE) {
ln->ln_state = ND6_LLINFO_STALE;
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
}
/*
@@ -1808,7 +1803,7 @@ nd6_output(ifp, origifp, m0, dst, rt0)
if (ln->ln_state == ND6_LLINFO_STALE) {
ln->ln_asked = 0;
ln->ln_state = ND6_LLINFO_DELAY;
- ln->ln_expire = time_second + nd6_delay;
+ ln->ln_expire = time.tv_sec + nd6_delay;
}
/*
@@ -1841,7 +1836,7 @@ nd6_output(ifp, origifp, m0, dst, rt0)
*/
if (ln->ln_expire && ln->ln_asked == 0) {
ln->ln_asked++;
- ln->ln_expire = time_second +
+ ln->ln_expire = time.tv_sec +
ND6_RETRANS_SEC(ND_IFINFO(ifp)->retrans);
nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0);
}
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index a42c49f6c44..2877ac37761 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.29 2003/05/22 10:20:57 itojun Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.30 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -545,7 +545,6 @@ nd6_na_input(m, off, icmp6len)
struct rtentry *rt;
struct sockaddr_dl *sdl;
union nd_opts ndopts;
- long time_second = time.tv_sec;
if (ip6->ip6_hlim != 255) {
nd6log((LOG_ERR,
@@ -654,11 +653,11 @@ nd6_na_input(m, off, icmp6len)
ln->ln_state = ND6_LLINFO_REACHABLE;
ln->ln_byhint = 0;
if (ln->ln_expire)
- ln->ln_expire = time_second +
+ ln->ln_expire = time.tv_sec +
ND_IFINFO(rt->rt_ifp)->reachable;
} else {
ln->ln_state = ND6_LLINFO_STALE;
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
}
if ((ln->ln_router = is_router) != 0) {
/*
@@ -712,7 +711,7 @@ nd6_na_input(m, off, icmp6len)
*/
if (ln->ln_state == ND6_LLINFO_REACHABLE) {
ln->ln_state = ND6_LLINFO_STALE;
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
}
goto freeit;
} else if (is_override /* (2a) */
@@ -735,13 +734,13 @@ nd6_na_input(m, off, icmp6len)
ln->ln_state = ND6_LLINFO_REACHABLE;
ln->ln_byhint = 0;
if (ln->ln_expire) {
- ln->ln_expire = time_second +
+ ln->ln_expire = time.tv_sec +
ND_IFINFO(ifp)->reachable;
}
} else {
if (lladdr && llchange) {
ln->ln_state = ND6_LLINFO_STALE;
- ln->ln_expire = time_second + nd6_gctimer;
+ ln->ln_expire = time.tv_sec + nd6_gctimer;
}
}
}
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index eed6e6ab42d..5d08babbf63 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.26 2003/05/15 15:00:43 itojun Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.27 2003/06/24 07:47:54 itojun Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -239,13 +239,12 @@ nd6_ra_input(m, off, icmp6len)
{
struct nd_defrouter dr0;
u_int32_t advreachable = nd_ra->nd_ra_reachable;
- long time_second = time.tv_sec;
Bzero(&dr0, sizeof(dr0));
dr0.rtaddr = saddr6;
dr0.flags = nd_ra->nd_ra_flags_reserved;
dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime);
- dr0.expire = time_second + dr0.rtlifetime;
+ dr0.expire = time.tv_sec + dr0.rtlifetime;
dr0.ifp = ifp;
/* unspecified or not? (RFC 2461 6.3.4) */
if (advreachable) {
@@ -271,7 +270,6 @@ nd6_ra_input(m, off, icmp6len)
struct nd_opt_hdr *pt;
struct nd_opt_prefix_info *pi = NULL;
struct nd_prefix pr;
- long time_second = time.tv_sec;
for (pt = (struct nd_opt_hdr *)ndopts.nd_opts_pi;
pt <= (struct nd_opt_hdr *)ndopts.nd_opts_pi_end;
@@ -330,7 +328,7 @@ nd6_ra_input(m, off, icmp6len)
pr.ndpr_plen = pi->nd_opt_pi_prefix_len;
pr.ndpr_vltime = ntohl(pi->nd_opt_pi_valid_time);
pr.ndpr_pltime = ntohl(pi->nd_opt_pi_preferred_time);
- pr.ndpr_lastupdate = time_second;
+ pr.ndpr_lastupdate = time.tv_sec;
if (in6_init_prefix_ltimes(&pr))
continue; /* prefix lifetime init failed */
@@ -1242,7 +1240,6 @@ prelist_update(new, dr, m)
struct in6_ifaddr *ifa6;
int ifa_plen;
u_int32_t storedlifetime;
- long time_second = time.tv_sec;
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -1295,7 +1292,7 @@ prelist_update(new, dr, m)
lt6_tmp = ifa6->ia6_lifetime;
if (lt6_tmp.ia6t_vltime == ND6_INFINITE_LIFETIME)
storedlifetime = ND6_INFINITE_LIFETIME;
- else if (time_second - ifa6->ia6_updatetime >
+ else if (time.tv_sec - ifa6->ia6_updatetime >
lt6_tmp.ia6t_vltime) {
/*
* The case of "invalid" address. We should usually
@@ -1304,7 +1301,7 @@ prelist_update(new, dr, m)
storedlifetime = 0;
} else
storedlifetime = lt6_tmp.ia6t_vltime -
- (time_second - ifa6->ia6_updatetime);
+ (time.tv_sec - ifa6->ia6_updatetime);
if (TWOHOUR < new->ndpr_vltime ||
storedlifetime < new->ndpr_vltime) {
lt6_tmp.ia6t_vltime = new->ndpr_vltime;
@@ -1335,7 +1332,7 @@ prelist_update(new, dr, m)
in6_init_address_ltimes(pr, &lt6_tmp);
ifa6->ia6_lifetime = lt6_tmp;
- ifa6->ia6_updatetime = time_second;
+ ifa6->ia6_updatetime = time.tv_sec;
}
if (ia6_match == NULL && new->ndpr_vltime) {
/*
@@ -1874,7 +1871,6 @@ in6_ifadd(pr)
int
in6_init_prefix_ltimes(struct nd_prefix *ndpr)
{
- long time_second = time.tv_sec;
/* check if preferred lifetime > valid lifetime. RFC2462 5.5.3 (c) */
if (ndpr->ndpr_pltime > ndpr->ndpr_vltime) {
@@ -1886,11 +1882,11 @@ in6_init_prefix_ltimes(struct nd_prefix *ndpr)
if (ndpr->ndpr_pltime == ND6_INFINITE_LIFETIME)
ndpr->ndpr_preferred = 0;
else
- ndpr->ndpr_preferred = time_second + ndpr->ndpr_pltime;
+ ndpr->ndpr_preferred = time.tv_sec + ndpr->ndpr_pltime;
if (ndpr->ndpr_vltime == ND6_INFINITE_LIFETIME)
ndpr->ndpr_expire = 0;
else
- ndpr->ndpr_expire = time_second + ndpr->ndpr_vltime;
+ ndpr->ndpr_expire = time.tv_sec + ndpr->ndpr_vltime;
return 0;
}
@@ -1898,14 +1894,13 @@ in6_init_prefix_ltimes(struct nd_prefix *ndpr)
static void
in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
{
- long time_second = time.tv_sec;
/* Valid lifetime must not be updated unless explicitly specified. */
/* init ia6t_expire */
if (lt6->ia6t_vltime == ND6_INFINITE_LIFETIME)
lt6->ia6t_expire = 0;
else {
- lt6->ia6t_expire = time_second;
+ lt6->ia6t_expire = time.tv_sec;
lt6->ia6t_expire += lt6->ia6t_vltime;
}
@@ -1913,7 +1908,7 @@ in6_init_address_ltimes(struct nd_prefix *new, struct in6_addrlifetime *lt6)
if (lt6->ia6t_pltime == ND6_INFINITE_LIFETIME)
lt6->ia6t_preferred = 0;
else {
- lt6->ia6t_preferred = time_second;
+ lt6->ia6t_preferred = time.tv_sec;
lt6->ia6t_preferred += lt6->ia6t_pltime;
}
}