Author: melifaro
Date: Wed Dec 18 22:10:56 2019
New Revision: 355888
URL: https://svnweb.freebsd.org/changeset/base/355888

Log:
  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

Modified:
  head/sys/netinet/icmp6.h
  head/sys/netinet6/in6_rmx.c

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h    Wed Dec 18 21:41:53 2019        (r355887)
+++ head/sys/netinet/icmp6.h    Wed Dec 18 22:10:56 2019        (r355888)
@@ -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;

Modified: head/sys/netinet6/in6_rmx.c
==============================================================================
--- head/sys/netinet6/in6_rmx.c Wed Dec 18 21:41:53 2019        (r355887)
+++ head/sys/netinet6/in6_rmx.c Wed Dec 18 22:10:56 2019        (r355888)
@@ -153,64 +153,8 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_he
 }
 
 /*
- * 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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to