[PATCH] Enable class E address space via --enable-class-e flag

Lincoln Dale ltd at interlink.com.au
Tue Jul 21 05:26:27 CEST 2020


This change enables Bird to establish BGP sessions to devices in class E
address space.

Without this change, prefixes in class e announced via BGP are
unconditionally ignored, e.g:

   $ bird -d
   bird: Started
   bird: Ignoring bogus route 241.1.2.3/32 received via <neighbor>

After this change, if configuration flag --enable-class-e is provided,
class E / bogons can still be ignored/filtered via routing policy but
aren't otherwise explicitly marked as invalid.

Marking class E addresses as bogus was previously discussed in Sep 2017
with no patch and no proposed change of behaviour (
https://bird.network.cz/pipermail/bird-users/2017-September/011558.html).

Signed-off-by: lincoln dale <ltd at interlink.com.au>

---
 diff --git a/configure.ac b/configure.ac
 index 40f021a..3f22fa5 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -48,6 +48,12 @@ AC_ARG_ENABLE([mpls-kernel],
    [enable_mpls_kernel=try]
  )

 +AC_ARG_ENABLE([class-e],
 +  [AS_HELP_STRING([--enable-class-e], [allow class E addresses to be
used])],
 +  [enable_class_e=yes],
 +  [enable_class_e=no]
 +)
 +
  AC_ARG_WITH([protocols],
    [AS_HELP_STRING([--with-protocols=LIST], [include specified routing
protocols @<:@all@:>@])],
    [],
 @@ -391,6 +397,10 @@ if test "$enable_debug" = yes ; then
    fi
  fi

 +if test "$enable_class_e" = yes ; then
 +  AC_DEFINE([ENABLE_CLASS_E], [1], [Define to 1 to enable support for
class E addresses.])
 +fi
 +
  CLIENT=birdcl
  CLIENT_LIBS=
  if test "$enable_client" = yes ; then
 @@ -454,6 +464,7 @@ AC_MSG_RESULT([        Debugging: $enable_debug])
  AC_MSG_RESULT([        POSIX threads: $enable_pthreads])
  AC_MSG_RESULT([        Routing protocols: $protocols])
  AC_MSG_RESULT([        Kernel MPLS support: $enable_mpls_kernel])
 +AC_MSG_RESULT([        Allow Class E addresses: $enable_class_e])
  AC_MSG_RESULT([        Client: $enable_client])

  rm -f $objdir/.*-stamp
 diff --git a/lib/ip.c b/lib/ip.c
 index 2d19516..143ef01 100644
 --- a/lib/ip.c
 +++ b/lib/ip.c
 @@ -103,6 +103,12 @@ ip4_classify(ip4_addr ad)
    if (a == 0xffffffff)
      return IADDR_BROADCAST | SCOPE_LINK;

 +#ifdef ENABLE_CLASS_E
 +  /* consider class E to be valid */
 +  if (b >= 0xf0)
 +      return IADDR_HOST | SCOPE_UNIVERSE;
 +#endif
 +
    return IADDR_INVALID;
  }
  ---
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20200720/50cf7b8d/attachment.htm>


More information about the Bird-users mailing list