Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- use nd6_rtdrain()

- the generic cached route management applied to pmtud and redirect cases
  • Loading branch information...
commit 4107605c0cc9059e00514560d7b8431a67f09529 1 parent ce058eb
jinmei authored
Showing with 17 additions and 9 deletions.
  1. +13 −5 kame/sys/netinet6/icmp6.c
  2. +4 −4 kame/sys/netinet6/nd6.c
18 kame/sys/netinet6/icmp6.c
View
@@ -1,4 +1,4 @@
-/* $KAME: icmp6.c,v 1.299 2002/04/12 05:11:46 jinmei Exp $ */
+/* $KAME: icmp6.c,v 1.300 2002/04/12 16:08:22 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -199,9 +199,11 @@ static int icmp6_mtudisc_lowat = 256;
static struct rttimer_queue *icmp6_redirect_timeout_q = NULL;
/* XXX do these values make any sense? */
+#ifdef __OpenBSD__
static int icmp6_redirect_hiwat = 1280;
static int icmp6_redirect_lowat = 1024;
#endif
+#endif
#ifndef __bsdi__
struct rttimer_queue *icmp6_mtudisc_timeout_q = NULL;
@@ -1374,7 +1376,9 @@ icmp6_mtudisc_update(ip6cp, dst, validated)
int validated;
{
#if defined(__NetBSD__) || defined(__OpenBSD__)
+#ifdef __OpenBSD__
unsigned long rtcount;
+#endif
struct icmp6_mtudisc_callback *mc;
#endif
struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6;
@@ -1400,7 +1404,9 @@ icmp6_mtudisc_update(ip6cp, dst, validated)
if (mtu < IPV6_MMTU)
return;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#ifdef __NetBSD__
+ ;
+#elif defined(__OpenBSD__)
/*
* allow non-validated cases if memory is plenty, to make traffic
* from non-connected pcb happy.
@@ -2849,11 +2855,13 @@ icmp6_redirect_input(m, off)
extern int icmp_redirtimeout; /* XXX */
#endif
#if defined(__NetBSD__) || defined(__OpenBSD__)
+#ifdef __OpenBSD__
unsigned long rtcount;
+#endif
struct rtentry *newrt = NULL;
#endif
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#ifdef __OpenBSD__
/*
* do not install redirect route, if the number of entries
* is too much (> hiwat). note that, the node (= host) will
@@ -3609,7 +3617,7 @@ icmp6_mtudisc_clone(dst)
error = rtrequest((int) RTM_ADD, dst,
(struct sockaddr *) rt->rt_gateway,
(struct sockaddr *) 0,
- RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC, &nrt);
+ RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC | RTF_CACHE, &nrt);
if (error) {
rtfree(rt);
return NULL;
@@ -3651,7 +3659,7 @@ icmp6_mtudisc_timeout(rt, r)
{
if (rt == NULL)
panic("icmp6_mtudisc_timeout: bad route to timeout");
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
if (!(rt->rt_rmx.rmx_locks & RTV_MTU))
rt->rt_rmx.rmx_mtu = nd_ifinfo[rt->rt_ifp->if_index].linkmtu;
#else /* i.e. netbsd and openbsd */
8 kame/sys/netinet6/nd6.c
View
@@ -1,4 +1,4 @@
-/* $KAME: nd6.c,v 1.239 2002/04/10 14:45:52 jinmei Exp $ */
+/* $KAME: nd6.c,v 1.240 2002/04/12 16:08:22 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -143,7 +143,7 @@ static struct sockaddr_in6 all1_sa;
static void nd6_slowtimo __P((void *));
static int regen_tmpaddr __P((struct in6_ifaddr *));
-#if defined(__FreeBSD__) && defined (RTF_CACHE)
+#if (defined(__FreeBSD__) || defined(__NetBSD__))
static void nd6_rtdrain __P((struct rtentry *, struct rttimer *));
#endif
static struct llinfo_nd6 *nd6_free __P((struct rtentry *, int));
@@ -1509,7 +1509,7 @@ nd6_rtrequest(req, rt, sa)
* if this is a cached route, which is very likely,
* put it in the timer queue.
*/
-#if defined(__FreeBSD__) && defined (RTF_CACHE)
+#if (defined(__FreeBSD__) || defined(__NetBSD__))
if (!(rt->rt_flags & (RTF_STATIC | RTF_ANNOUNCE)) && !mine)
rt_add_cache(rt, nd6_rtdrain);
#endif /* freebsd and rtf_cache */
@@ -1550,7 +1550,7 @@ nd6_rtrequest(req, rt, sa)
}
}
-#if defined(__FreeBSD__) && defined (RTF_CACHE)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
static void
nd6_rtdrain(rt, rtt)
struct rtentry *rt;
Please sign in to comment.
Something went wrong with that request. Please try again.