Skip to content
Snippets Groups Projects
  1. Jan 05, 2022
  2. Dec 28, 2021
  3. Dec 27, 2021
    • Ondřej Zajíček's avatar
      BSD: Assume onlink flag on ifaces with only host addresses · a39cd2cc
      Ondřej Zajíček authored
      The BSD kernel does not support the onlink flag and BIRD does not use
      direct routes for next hop validation, instead depends on interface
      address ranges. We would like to handle PtMP cases with only host
      addresses configured, like:
      
        ifconfig wg0 192.168.0.10/32
        route add 192.168.0.4 -iface wg0
        route add 192.168.0.8 -iface wg0
      
      To accept BIRD routes with onlink next-hop, like:
      
        route 192.168.42.0/24 via 192.168.0.4%wg0 onlink
      
      BIRD would dismiss the route when receiving from the kernel, as the
      next-hop 192.168.0.4 is not part of any interface subnet and onlink
      flag is not kept by the BSD kernel.
      
      The commit fixes this by assuming that for routes received from the
      kernel, any next-hop is onlink on ifaces with only host addresses.
      
      Thanks to Stefan Haller for the original patch.
      a39cd2cc
  4. Dec 18, 2021
    • Job Snijders's avatar
      RPKI: Add contextual out-of-bound checks in RTR Prefix PDU handler · b9f38727
      Job Snijders authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      RFC 6810 and RFC 8210 specify that the "Max Length" value MUST NOT be
      less than the Prefix Length element (underflow). On the other side,
      overflow of the Max Length element also is possible, it being an 8-bit
      unsigned integer allows for values larger than 32 or 128. This also
      implicitly ensures there is no overflow of "Length" value.
      
      When a PDU is received where the Max Length field is corrputed, the RTR
      client (BIRD) should immediately terminate the session, flush all data
      learned from that cache, and log an error for the operator.
      
      Minor changes done by commiter.
      b9f38727
    • Simon Ruderich's avatar
      Doc: bgp: remove "advertise ipv4" · 00410fd6
      Simon Ruderich authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      The option was removed in d15b0b0a ("BGP redesign", 2016-12-07)
      but the documentation wasn't updated.
      00410fd6
    • Ondřej Zajíček's avatar
      Nest: Do not ignore secondary flag changes in ifa updates · b21104c9
      Ondřej Zajíček authored
      Compare all IA_* flags that are set by sysdep iface code.
      
      The old code ignores IA_SECONDARY flag when comparing whether iface
      address updates from kernel changed anything. This is usually not an
      issue as kernel removes all secondary addresses due to removal of the
      primary one, but it breaks when sysctl 'promote_secondaries' is enabled
      and kernel promotes secondary addresses to primary ones.
      
      Thanks to 'Alexander' for the bugreport.
      b21104c9
  5. Nov 27, 2021
    • Maria Matejka's avatar
      Memory statistics split into Effective and Overhead · f772afc5
      Maria Matejka authored
      This feature is intended mostly for checking that BIRD's allocation
      strategies don't consume much memory space. There are some cases where
      withdrawing routes in a specific order lead to memory fragmentation and
      this output should give the user at least a notion of how much memory is
      actually used for data storage and how much memory is "just allocated"
      or used for overhead.
      
      Also raising the "system allocator overhead estimation" from 8 to 16
      bytes; it is probably even more. I've found 16 as a local minimum in
      best scenarios among reachable machines. I couldn't find any reasonable
      method to estimate this value when BIRD starts up.
      
      This commit also fixes the inaccurate computation of memory overhead for
      slabs where the "system allocater overhead estimation" was improperly
      added to the size of mmap-ed memory.
      f772afc5
  6. Nov 24, 2021
  7. Oct 20, 2021
    • Ondřej Zajíček's avatar
      Conf: Fix crash during shutdown · 9f24fef5
      Ondřej Zajíček authored
      BIRD implements shutdown by reconfiguring to fake empty configuration.
      Such fake config structure is created from the last running config and
      shares some data, including symbol table. This allows access to (removed)
      routing tables and causes crash when 'show route' command is used during
      shutdown.
      
      Clean up symbol table, table list and links to default tables, so removed
      routing tables cannot be accessed during shutdown.
      9f24fef5
  8. Jun 17, 2021
  9. Jun 14, 2021
  10. Jun 11, 2021
  11. Jun 09, 2021
  12. 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
  13. 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
  14. 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
  15. May 26, 2021
  16. May 20, 2021
  17. May 19, 2021
Loading