Skip to content
Snippets Groups Projects
  1. Feb 06, 2022
    • Ondřej Zajíček's avatar
      Nest: Implement locking of prefix tries during walks · 5a89edc6
      Ondřej Zajíček authored
      The prune loop may may rebuild the prefix trie and therefore invalidate
      walk state for asynchronous walks (used in 'show route in' cmd). Fix it
      by adding locking that keeps the old trie in memory until current walks
      are done.
      
      In future this could be improved by rebuilding trie walk states (by
      lookup for last found prefix) after the prefix trie rebuild.
      5a89edc6
    • Ondřej Zajíček's avatar
      Nest: Implement prefix trie pruning · de6318f7
      Ondřej Zajíček authored
      When rtable is pruned and network fib nodes are removed, we also need to
      prune prefix trie. Unfortunately, rebuilding prefix trie takes long time
      (got about 400 ms for 1M networks), so must not be atomic, we have to
      rebuild a new trie while current one is still active. That may require
      some considerable amount of temporary memory, so we do that only if
      we expect significant trie size reduction.
      de6318f7
    • Ondřej Zajíček's avatar
      Trie: Add prefix counter · ba5aec94
      Ondřej Zajíček authored
      Add counter of prefixes stored in trie. Works only for 'restricted' tries
      composed of explicit prefixes (pxlen == l == h), like ones used in rtables.
      ba5aec94
    • Ondřej Zajíček's avatar
      Doc: Describe routing table options · d0f9a77f
      Ondřej Zajíček authored
      d0f9a77f
    • Ondřej Zajíček's avatar
      BGP: Implement flowspec validation procedure · 1f2eb2ac
      Ondřej Zajíček authored
      Implement flowspec validation procedure as described in RFC 8955 sec. 6
      and RFC 9117. The Validation procedure enforces that only routers in the
      forwarding path for a network can originate flowspec rules for that
      network.
      
      The patch adds new mechanism for tracking inter-table dependencies, which
      is necessary as the flowspec validation depends on IP routes, and flowspec
      rules must be revalidated when best IP routes change.
      
      The validation procedure is disabled by default and requires that
      relevant IP table uses trie, as it uses interval queries for subnets.
      1f2eb2ac
    • Ondřej Zajíček's avatar
      Nest: Add routing table configuration blocks · 1ae42e52
      Ondřej Zajíček authored
      Allow to specify sorted flag, trie fla, and min/max settle time.
      
      Also do not enable trie by default, it must be explicitly enabled.
      1ae42e52
    • Ondřej Zajíček's avatar
    • Ondřej Zajíček's avatar
      Nest: Avoid unnecessary net_format() in 'show route' command · 61375bd0
      Ondřej Zajíček authored
      When output of 'show route' command was generated, the net_format() was
      called for each network prematurely, even if the result was not needed.
      
      Fix the code to call net_format() only when needed. This makes queries
      that process many networks but show only few (e.g. 'show route where ..',
      or 'show route count') much faster (like 5x - 10x faster).
      61375bd0
    • Ondřej Zajíček's avatar
      Nest: Add trie iteration code to 'show route' · 9ac16df3
      Ondřej Zajíček authored
      Add trie iteration code to rt_show_cont() CLI hook and use it to
      accelerate 'show route in <addr>' commands using interval queries.
      9ac16df3
    • Ondřej Zajíček's avatar
      Nest: Implement 'show route in <addr>' command · ea97b890
      Ondřej Zajíček authored
      Implement 'show route in <addr>' command, which shows all routes in
      networks that are subnets of given network. Currently limited to IP
      network types.
      ea97b890
    • Ondřej Zajíček's avatar
      Nest: Attach prefix trie to rtable for faster LPM and interval queries · 836a87b8
      Ondřej Zajíček authored
      Attach a prefix trie to IP/VPN/ROA tables. Use it for net_route() and
      net_roa_check(). This leads to 3-5x speedups for IPv4 and 5-10x
      speedup for IPv6 of these calls.
      
      TODO:
       - Rebuild the trie during rt_prune_table()
       - Better way to avoid trie_add_prefix() in net_get() for existing tables
       - Make it configurable (?)
      836a87b8
  2. Dec 02, 2021
  3. Nov 26, 2021
  4. Nov 19, 2021
    • Ondřej Zajíček's avatar
      Trie: Implement trie walking code · 062e69bf
      Ondřej Zajíček authored
      Trie walking allows enumeration of prefixes in a trie in the usual
      lexicographic order. Optionally, trie enumeration can be restricted
      to a chosen subnet (and its descendants).
      062e69bf
  5. Nov 13, 2021
  6. Sep 25, 2021
  7. Jun 17, 2021
  8. Jun 14, 2021
  9. Jun 11, 2021
  10. Jun 09, 2021
  11. Jun 06, 2021
    • Ondřej Zajíček's avatar
      Nest: Fix password list parsing code · 8eea396b
      Ondřej Zajíček authored
      One of previous patches broke password list parsing code, fix that.
      8eea396b
    • Ondřej Zajíček's avatar
      Lib: Fix static assert macro · ee9516db
      Ondřej Zajíček authored
      ee9516db
    • Ondřej Zajíček's avatar
      Babel: Add MAC authentication support - update · b174cc0a
      Ondřej Zajíček authored
      Some cleanups and bugfixes to the previous patch, including:
      
       - Fix rate limiting in index mismatch check
      
       - Fix missing BABEL_AUTH_INDEX_LEN in auth_tx_overhead computation
      
       - Fix missing auth_tx_overhead recalculation during reconfiguration
      
       - Fix pseudoheader construction in babel_auth_sign() (sport vs fport)
      
       - Fix typecasts for ptrdiffs in log messages
      
       - Make auth log messages similar to corresponding RIP/OSPF ones
      
       - Change auth log messages for events that happen during regular
         operation to debug messages
      
       - Switch meaning of babel_auth_check*() functions for consistency
         with corresponding RIP/OSPF ones
      
       - Remove requirement for min/max key length, only those required by
         given MAC code are enforced
      b174cc0a
    • Toke Høiland-Jørgensen's avatar
      Babel: Add MAC authentication support · b218a28f
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      This implements support for MAC authentication in the Babel protocol, as
      specified by RFC 8967. The implementation seeks to follow the RFC as close
      as possible, with the only deliberate deviation being the addition of
      support for all the HMAC algorithms already supported by Bird, as well as
      the Blake2b variant of the Blake algorithm.
      
      For description of applicability, assumptions and security properties,
      see RFC 8967 sections 1.1 and 1.2.
      b218a28f
    • Toke Høiland-Jørgensen's avatar
      Babel: Refactor TLV parsing code for easier reuse · 69d10132
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      In preparation for adding authentication checks, refactor the TLV
      walking code so it can be reused for a separate pass of the packet
      for authentication checks.
      69d10132
    • Toke Høiland-Jørgensen's avatar
      Nest: Allow MAC algorithms to specify min/max key length · 589f7d1e
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Add min/max key length fields to the MAC algorithm description and
      validate configured keys before they are used.
      589f7d1e
    • Toke Høiland-Jørgensen's avatar
      Nest: Allow specifying security keys as hex bytes as well as strings · 35f88b30
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Add support for specifying a password in hexadecimal format, The result
      is the same whether a password is specified as a quoted string or a
      hex-encoded byte string, this just makes it more convenient to input
      high-entropy byte strings as MAC keys.
      35f88b30
    • Toke Høiland-Jørgensen's avatar
      Lib: Add tests for blake2s and blake2b · f1a82419
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Import the blake2-kat.h header with test vector output from the blake
      reference implementation, and add tests to mac_test.c to compare the
      output of the Bird MAC algorithm implementations with that reference
      output.
      
      Since the reference implementation only has test vectors for the full
      output size, there are no tests for the smaller-sized output variants.
      f1a82419
    • Toke Høiland-Jørgensen's avatar
      Lib: Add Blake2s and Blake2b hash functions · 725d9af9
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      The Babel MAC authentication RFC recommends implementing Blake2s as one of
      the supported algorithms. In order to achieve do this, add the blake2b and
      blake2s hash functions for MAC authentication. The hashing function
      implementations are the reference implementations from blake2.net.
      
      The Blake2 algorithms allow specifying an arbitrary output size, and the
      Babel MAC spec says to implement Blake2s with 128-bit output. To satisfy
      this, we add two different variants of each of the algorithms, one using
      the default size (256 bits for Blake2s, 512 bits for Blake2b), and one
      using half the default output size.
      
      Update to BIRD coding style done by committer.
      725d9af9
    • Ondřej Zajíček's avatar
      sysdep: Add wrapper to get random bytes - update · e5724f71
      Ondřej Zajíček authored
      Simplify the code and fix an issue with getentropy() return value.
      e5724f71
    • Toke Høiland-Jørgensen's avatar
      sysdep: Add wrapper to get random bytes · c48ebde5
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Add a wrapper function in sysdep to get random bytes, and required checks
      in configure.ac to select how to do it. The configure script tries, in
      order, getrandom(), getentropy() and reading from /dev/urandom.
      c48ebde5
  12. Jun 01, 2021
    • Ondřej Zajíček's avatar
      BGP: Ensure that freed neighbor entry is not accessed · 91d04583
      Ondřej Zajíček authored
      Routes from downed protocols stay in rtable (until next rtable prune
      cycle ends) and may be even exported to another protocol. In BGP case,
      source BGP protocol is examined, although dynamic parts (including
      neighbor entries) are already freed. That may lead to crash under some
      race conditions. Ensure that freed neighbor entry is not accessed to
      avoid this issue.
      91d04583
  13. May 30, 2021
    • Maria Matejka's avatar
      Babel: Seqno requests are properly decoupled from neighbors when the... · ebd5751c
      Maria Matejka authored
      Babel: Seqno requests are properly decoupled from neighbors when the underlying interface disappears
      
      When an interface disappears, all the neighbors are freed as well. Seqno
      requests were anyway not decoupled from them, leading to strange
      segfaults. This fix adds a proper seqno request list inside neighbors to
      make sure that no pointer to neighbor is kept after free.
      ebd5751c
Loading