summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-02-23 06:40:21 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-02-23 06:40:21 +0000
commit5c094c211f4ea87ed5aa2b88fdb9014499a5d771 (patch)
tree0a511afca6b69f0e039d5394ac2adfc38c24a794 /sys
parent33537e68c8767e2203440181cb7b7112e1cb7d00 (diff)
remove unnecessary state, ND6_LLINFO_WAITDELETE, from neighbor cache
state machine. no need for RTF_REJECT on neighbor cache entires, they are leftover from ARP code. sync with kame.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/nd6.c52
-rw-r--r--sys/netinet6/nd6.h13
2 files changed, 13 insertions, 52 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 5f069b783c0..2a4df082f46 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.27 2001/02/21 17:22:05 itojun Exp $ */
+/* $OpenBSD: nd6.c,v 1.28 2001/02/23 06:40:20 itojun Exp $ */
/* $KAME: nd6.c,v 1.131 2001/02/21 16:28:18 itojun Exp $ */
/*
@@ -504,9 +504,6 @@ nd6_timer(ignored_arg)
} else
next = nd6_free(rt);
break;
- case ND6_LLINFO_WAITDELETE:
- next = nd6_free(rt);
- break;
}
ln = next;
}
@@ -640,29 +637,6 @@ nd6_purge(ifp)
}
ln = nln;
}
-
- /*
- * Neighbor cache entry for interface route will be retained
- * with ND6_LLINFO_WAITDELETE state, by nd6_free(). Nuke it.
- */
- ln = llinfo_nd6.ln_next;
- while (ln && ln != &llinfo_nd6) {
- struct rtentry *rt;
- struct sockaddr_dl *sdl;
-
- nln = ln->ln_next;
- rt = ln->ln_rt;
- if (rt && rt->rt_gateway &&
- rt->rt_gateway->sa_family == AF_LINK) {
- sdl = (struct sockaddr_dl *)rt->rt_gateway;
- if (sdl->sdl_index == ifp->if_index) {
- rtrequest(RTM_DELETE, rt_key(rt),
- (struct sockaddr *)0, rt_mask(rt), 0,
- (struct rtentry **)0);
- }
- }
- ln = nln;
- }
}
struct rtentry *
@@ -819,7 +793,6 @@ nd6_free(rt)
struct rtentry *rt;
{
struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo, *next;
- struct sockaddr_dl *sdl;
struct in6_addr in6 = ((struct sockaddr_in6 *)rt_key(rt))->sin6_addr;
struct nd_defrouter *dr;
@@ -877,15 +850,6 @@ nd6_free(rt)
splx(s);
}
- if (rt->rt_refcnt > 0 && (sdl = SDL(rt->rt_gateway)) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_alen = 0;
- ln->ln_state = ND6_LLINFO_WAITDELETE;
- ln->ln_asked = 0;
- rt->rt_flags &= ~RTF_REJECT;
- return ln->ln_next;
- }
-
/*
* Before deleting the entry, remember the next entry as the
* return value. We need this because pfxlist_onlink_check() above
@@ -1033,14 +997,12 @@ nd6_resolve(ifp, rt, m, dst, desten)
* XXX Does the code conform to rate-limiting rule?
* (RFC 2461 7.2.2)
*/
- if (ln->ln_state == ND6_LLINFO_WAITDELETE ||
- ln->ln_state == ND6_LLINFO_NOSTATE)
+ if (ln->ln_state == ND6_LLINFO_NOSTATE)
ln->ln_state = ND6_LLINFO_INCOMPLETE;
if (ln->ln_hold)
m_freem(ln->ln_hold);
ln->ln_hold = m;
if (ln->ln_expire) {
- rt->rt_flags &= ~RTF_REJECT;
if (ln->ln_asked < nd6_mmaxtries &&
ln->ln_expire < time_second) {
ln->ln_asked++;
@@ -1673,7 +1635,6 @@ fail:
ln->ln_state = newstate;
if (ln->ln_state == ND6_LLINFO_STALE) {
- rt->rt_flags &= ~RTF_REJECT;
if (ln->ln_hold) {
#ifdef OLDIP6OUTPUT
(*ifp->if_output)(ifp, ln->ln_hold,
@@ -1860,9 +1821,6 @@ nd6_output(ifp, origifp, m0, dst, rt0)
*/
if (!nd6_is_addr_neighbor(gw6, ifp) ||
in6ifa_ifpwithaddr(ifp, &gw6->sin6_addr)) {
- if (rt->rt_flags & RTF_REJECT)
- senderr(EHOSTDOWN);
-
/*
* We allow this kind of tricky route only
* when the outgoing interface is p2p.
@@ -1883,8 +1841,6 @@ nd6_output(ifp, origifp, m0, dst, rt0)
senderr(EHOSTUNREACH);
}
}
- if (rt->rt_flags & RTF_REJECT)
- senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
}
/*
@@ -1954,14 +1910,12 @@ nd6_output(ifp, origifp, m0, dst, rt0)
* XXX Does the code conform to rate-limiting rule?
* (RFC 2461 7.2.2)
*/
- if (ln->ln_state == ND6_LLINFO_WAITDELETE ||
- ln->ln_state == ND6_LLINFO_NOSTATE)
+ if (ln->ln_state == ND6_LLINFO_NOSTATE)
ln->ln_state = ND6_LLINFO_INCOMPLETE;
if (ln->ln_hold)
m_freem(ln->ln_hold);
ln->ln_hold = m;
if (ln->ln_expire) {
- rt->rt_flags &= ~RTF_REJECT;
if (ln->ln_asked < nd6_mmaxtries &&
ln->ln_expire < time_second) {
ln->ln_asked++;
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 8602879222f..066a896cc98 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: nd6.h,v 1.12 2001/02/08 15:07:28 itojun Exp $ */
-/* $KAME: nd6.h,v 1.46 2001/02/08 10:57:00 itojun Exp $ */
+/* $OpenBSD: nd6.h,v 1.13 2001/02/23 06:40:20 itojun Exp $ */
+/* $KAME: nd6.h,v 1.52 2001/02/19 04:40:37 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -54,7 +54,14 @@ struct llinfo_nd6 {
};
#define ND6_LLINFO_NOSTATE -2
-#define ND6_LLINFO_WAITDELETE -1
+/*
+ * We don't need the WAITDELETE state any more, but we keep the definition
+ * in a comment line instead of removing it. This is necessary to avoid
+ * unintentionally reusing the value for another purpose, which might
+ * affect backward compatibility with old applications.
+ * (20000711 jinmei@kame.net)
+ */
+/* #define ND6_LLINFO_WAITDELETE -1 */
#define ND6_LLINFO_INCOMPLETE 0
#define ND6_LLINFO_REACHABLE 1
#define ND6_LLINFO_STALE 2