Browse Source

zebra, ripngd: remove ::/64 special-casing

In the 90ies, IPv4 was believed to exist within IPv6, with some kernels
implementing this belief in code...  Our code here is keyed to "#ifdef
LINUX", yet no Linux from the past 10 years had this, making the code
completely useless.

FreeBSD 10.0 does in fact have a "::/96 via ::1 dev lo0 reject" route.
IMHO we shouldn't mess with that, the admin can filter as neccessary
anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
[DL: slightly adjusted commit message to remove misunderstanding]
Acked-by: Paul Jakma <paul@jakma.org>
David Lamparter 5 years ago
parent
commit
86a82e99aa
2 changed files with 0 additions and 43 deletions
  1. 0 18
      ripngd/ripngd.c
  2. 0 25
      zebra/zebra_rib.c

+ 0 - 18
ripngd/ripngd.c

@@ -928,15 +928,6 @@ ripng_redistribute_add (int type, int sub_type, struct prefix_ipv6 *p,
     return;
   if (IN6_IS_ADDR_LOOPBACK (&p->prefix))
     return;
-#ifdef LINUX
-  /* XXX As long as the RIPng redistribution is applied to all the connected
-   *     routes, one needs to filter the ::/96 prefixes.
-   *     However it could be a wanted case, it will be removed soon.
-   */
-  if ((IN6_IS_ADDR_V4COMPAT(&p->prefix)) ||
-      (IN6_IS_ADDR_UNSPECIFIED (&p->prefix) && (p->prefixlen == 96)))
-    return;
-#endif /* LINUX */
 
   rp = route_node_get (ripng->table, (struct prefix *) p);
   rinfo = rp->info;
@@ -1025,15 +1016,6 @@ ripng_redistribute_delete (int type, int sub_type, struct prefix_ipv6 *p,
     return;
   if (IN6_IS_ADDR_LOOPBACK (&p->prefix))
     return;
-#ifdef LINUX
-  /* XXX As long as the RIPng redistribution is applied to all the connected
-   *     routes, one needs to filter the ::/96 prefixes.
-   *     However it could be a wanted case, it will be removed soon.
-   */
-  if ((IN6_IS_ADDR_V4COMPAT(&p->prefix)) ||
-      (IN6_IS_ADDR_UNSPECIFIED (&p->prefix) && (p->prefixlen == 96)))
-    return;
-#endif /* LINUX */
 
   rp = route_node_lookup (ripng->table, (struct prefix *) p);
 

+ 0 - 25
zebra/zebra_rib.c

@@ -2687,27 +2687,6 @@ static_delete_ipv4_safi (safi_t safi, struct prefix *p, struct in_addr *gate,
 }
 
 #ifdef HAVE_IPV6
-static int
-rib_bogus_ipv6 (int type, struct prefix_ipv6 *p,
-		struct in6_addr *gate, unsigned int ifindex, int table)
-{
-  if (type == ZEBRA_ROUTE_CONNECT && IN6_IS_ADDR_UNSPECIFIED (&p->prefix)) {
-#ifdef LINUX
-    /* IN6_IS_ADDR_V4COMPAT(&p->prefix) */
-    if (p->prefixlen == 96)
-      return 0;
-#endif /* LINUX */
-    return 1;
-  }
-  if (type == ZEBRA_ROUTE_KERNEL && IN6_IS_ADDR_UNSPECIFIED (&p->prefix)
-      && p->prefixlen == 96 && gate && IN6_IS_ADDR_UNSPECIFIED (gate))
-    {
-      kernel_delete_ipv6_old (p, gate, ifindex, 0, table);
-      return 1;
-    }
-  return 0;
-}
-
 int
 rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p,
 	      struct in6_addr *gate, unsigned int ifindex, u_int32_t vrf_id,
@@ -2734,10 +2713,6 @@ rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p,
   if (type == ZEBRA_ROUTE_BGP && CHECK_FLAG (flags, ZEBRA_FLAG_IBGP))
     distance = 200;
 
-  /* Filter bogus route. */
-  if (rib_bogus_ipv6 (type, p, gate, ifindex, 0))
-    return 0;
-
   /* Lookup route node.*/
   rn = route_node_get (table, (struct prefix *) p);