diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-03-25 15:59:24 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-03-25 15:59:24 +0000 |
commit | 083ceec3f079cd3240f4ce0aa8017ed5da990ad1 (patch) | |
tree | eb9c423a3a1fe2847ba940dc3484b14266c72b35 /sys/netinet6 | |
parent | 40ab26523f5c35ebfb3d6a6a934faf1e1cd23c36 (diff) |
sync nd6_resolve() uptime handling with arpresolve()
makes the two familiar functions look more alike; OK bluhm
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index ee5a250e6e3..86c04e9ddcf 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.265 2023/01/24 20:06:16 claudio Exp $ */ +/* $OpenBSD: nd6.c,v 1.266 2023/03/25 15:59:23 kn Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -1247,16 +1247,18 @@ nd6_resolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, struct sockaddr_dl *sdl; struct rtentry *rt; struct llinfo_nd6 *ln = NULL; + time_t uptime; if (m->m_flags & M_MCAST) { ETHER_MAP_IPV6_MULTICAST(&satosin6(dst)->sin6_addr, desten); return (0); } + uptime = getuptime(); rt = rt_getll(rt0); if (ISSET(rt->rt_flags, RTF_REJECT) && - (rt->rt_expire == 0 || getuptime() < rt->rt_expire)) { + (rt->rt_expire == 0 || rt->rt_expire > uptime)) { m_freem(m); return (rt == rt0 ? EHOSTDOWN : EHOSTUNREACH); } |