diff options
author | ume <ume@FreeBSD.org> | 2002-02-28 17:05:46 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2002-02-28 17:05:46 +0000 |
commit | 7bf004382faaec4048fe51fff89505f13a1bed3a (patch) | |
tree | 2829b10aceeb19102d78abdc80a600376f3f5ba1 /sys/netinet6 | |
parent | b60aca7d4b27fa1e21a79db947dce17304f76bc1 (diff) | |
download | FreeBSD-src-7bf004382faaec4048fe51fff89505f13a1bed3a.zip FreeBSD-src-7bf004382faaec4048fe51fff89505f13a1bed3a.tar.gz |
- In nd6_rtrequest(), ignored a route when it is created by cloning and
is not a neighbor. see comments for the detailed reason.
- Rejected the process of nd6_rtrequest() when the request is RESOLVE and
the interface does not need neighbor caches.
Obtained from: KAME
MFC After: 1 week
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 2dd1758..c5b8101 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1110,6 +1110,27 @@ nd6_rtrequest(req, rt, info) return; } + if (req == RTM_RESOLVE && + (nd6_need_cache(ifp) == 0 || /* stf case */ + !nd6_is_addr_neighbor((struct sockaddr_in6 *)rt_key(rt), ifp))) { + /* + * FreeBSD and BSD/OS often make a cloned host route based + * on a less-specific route (e.g. the default route). + * If the less specific route does not have a "gateway" + * (this is the case when the route just goes to a p2p or an + * stf interface), we'll mistakenly make a neighbor cache for + * the host route, and will see strange neighbor solicitation + * for the corresponding destination. In order to avoid the + * confusion, we check if the destination of the route is + * a neighbor in terms of neighbor discovery, and stop the + * process if not. Additionally, we remove the LLINFO flag + * so that ndp(8) will not try to get the neighbor information + * of the destination. + */ + rt->rt_flags &= ~RTF_LLINFO; + return; + } + switch (req) { case RTM_ADD: /* |