Remove useless code from in6_rmx.c

The code in questions walks IPv6 tree every 60 seconds and looks into
 the routes with non-zero expiration time (typically, redirected routes).
For each such route it sets RTF_PROBEMTU flag at the expiration time.
No other part of the kernel checks for RTF_PROBEMTU flag.

RTF_PROBEMTU was defined 21 years ago, 30 Jun 1999, as RTF_PROTO1.
RTF_PROTO1 is a de-facto standard indication of a route installed
 by a routing daemon for a last decade.

Reviewed by:	bz, ae
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D22865
This commit is contained in:
Alexander V. Chernikov 2019-12-18 22:10:56 +00:00
parent 6074a3c0f4
commit bdb214a4a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355888
2 changed files with 0 additions and 65 deletions

View File

@ -687,8 +687,6 @@ void kmod_icmp6stat_inc(int statnum);
#define ICMPV6CTL_NODEINFO_OLDMCPREFIX 25
#define ICMPV6CTL_MAXID 26
#define RTF_PROBEMTU RTF_PROTO1
#ifdef _KERNEL
# ifdef __STDC__
struct rtentry;

View File

@ -152,65 +152,9 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_head *head,
return (rn_addroute(v_arg, n_arg, head, treenodes));
}
/*
* Age old PMTUs.
*/
struct mtuex_arg {
struct rib_head *rnh;
time_t nextstop;
};
VNET_DEFINE_STATIC(struct callout, rtq_mtutimer);
#define V_rtq_mtutimer VNET(rtq_mtutimer)
static int
in6_mtuexpire(struct rtentry *rt, void *rock)
{
struct mtuex_arg *ap = rock;
if (rt->rt_expire && !(rt->rt_flags & RTF_PROBEMTU)) {
if (rt->rt_expire <= time_uptime) {
rt->rt_flags |= RTF_PROBEMTU;
} else {
ap->nextstop = lmin(ap->nextstop, rt->rt_expire);
}
}
return (0);
}
#define MTUTIMO_DEFAULT (60*1)
static void
in6_mtutimo_setwa(struct rib_head *rnh, uint32_t fibum, int af,
void *_arg)
{
struct mtuex_arg *arg;
arg = (struct mtuex_arg *)_arg;
arg->rnh = rnh;
}
static void
in6_mtutimo(void *rock)
{
CURVNET_SET_QUIET((struct vnet *) rock);
struct timeval atv;
struct mtuex_arg arg;
rt_foreach_fib_walk(AF_INET6, in6_mtutimo_setwa, in6_mtuexpire, &arg);
atv.tv_sec = MTUTIMO_DEFAULT;
atv.tv_usec = 0;
callout_reset(&V_rtq_mtutimer, tvtohz(&atv), in6_mtutimo, rock);
CURVNET_RESTORE();
}
/*
* Initialize our routing tree.
*/
VNET_DEFINE_STATIC(int, _in6_rt_was_here);
#define V__in6_rt_was_here VNET(_in6_rt_was_here)
int
in6_inithead(void **head, int off)
@ -224,12 +168,6 @@ in6_inithead(void **head, int off)
rh->rnh_addaddr = in6_addroute;
*head = (void *)rh;
if (V__in6_rt_was_here == 0) {
callout_init(&V_rtq_mtutimer, 1);
in6_mtutimo(curvnet); /* kick off timeout first time */
V__in6_rt_was_here = 1;
}
return (1);
}
@ -238,7 +176,6 @@ int
in6_detachhead(void **head, int off)
{
callout_drain(&V_rtq_mtutimer);
rt_table_destroy((struct rib_head *)(*head));
return (1);