Skip to content
Snippets Groups Projects
  1. Mar 27, 2025
  2. Dec 10, 2024
  3. Dec 02, 2024
    • Maria Matejka's avatar
      CLI: Dumping internal data structures to files, not to debug output · da8a2327
      Maria Matejka authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      All the 'dump something' CLI commands now have a new mandatory
      argument -- name of the file where to dump the data. This allows
      for more flexible dumping even for production deployments where
      the debug output is by default off.
      
      Also the dump commands are now restricted (they weren't before)
      to assure that only the appropriate users can run these time consuming
      commands.
      da8a2327
  4. Mar 19, 2024
  5. Aug 23, 2023
    • Ondřej Zajíček's avatar
      Nest: Treat VRF interfaces as inside respective VRFs · e3c0eca9
      Ondřej Zajíček authored
      Despite not having defined 'master interface', VRF interfaces should be
      treated as being inside respective VRFs. They behave as a loopback for
      respective VRFs. Treating the VRF interface as inside the VRF allows
      e.g. OSPF to pick up IP addresses defined on the VRF interface.
      
      For this, we also need to tell apart VRF interfaces and regular interfaces.
      Extend Netlink code to parse interface type and mark VRF interfaces with
      IF_VRF flag.
      
      Based on the patch from Erin Shepherd, thanks!
      e3c0eca9
  6. Jun 02, 2023
    • Ondřej Zajíček's avatar
      Babel: Minor changes to RTT formatting · 69372dc9
      Ondřej Zajíček authored
      Use existing %t printf code and move 'ms' in CLI output to table header.
      69372dc9
    • Toke Høiland-Jørgensen's avatar
      Babel: Add support for the RTT extension · f08abcb8
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      This adds support to the Babel protocol for the RTT extension specified
      in draft-ietf-babel-rtt-extension. While this extension is not yet at the
      RFC stage, it is one of the more useful extensions to Babel[0], so it
      seems worth having in Bird as well.
      
      The extension adds timestamps to Hello and IHU TLVs and uses these to
      compute an RTT to each neighbour. An extra per-neighbour cost is then
      computed from the RTT based on a minimum and maximum interval and cost
      value specified in the configuration. The primary use case for this is
      improving routing in a geographically distributed tunnel-based overlay
      network.
      
      The implementation follows the babeld implementation when picking
      constants and default configuration values. It also uses the same RTT
      smoothing algorithm as babeld, and follows it in adding a new 'tunnel'
      interface type which enables RTT by default.
      
      [0] https://alioth-lists.debian.net/pipermail/babel-users/2022-April/003932.html
      f08abcb8
  7. Feb 19, 2023
  8. Feb 14, 2023
    • Toke Høiland-Jørgensen's avatar
      Babel: Keep separate auth PC counters for unicast and multicast · ee919658
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      The babel protocol normally sends all its messages as multicast packets,
      but the protocol specification allows most messages to be sent as either
      unicast or multicast, and the two can be mixed freely. In particular, the
      babeld implementation can be configured to unicast updates to all peers
      instead of sending them as unicast.
      
      Daniel discovered that this can cause problems with the packet counter
      checks in the MAC extension due to packet reordering. This happens on WiFi
      networks where clients have power save enabled (which is quite common in
      infrastructure networks): in this case, the access point will buffer all
      multicast traffic and only send it out along with its beacons, leading to a
      maximum buffering in default Linux-based access point configuration of up
      to 200 ms.
      
      This means that a Babel sender that mixes unicast and multicast messages
      can have the unicast messages overtake the multicast messages because of
      this buffering; when authentication is enabled, this causes the receiver to
      discard the multicast message when it does arrive because it now has a
      packet counter value less than the unicast message that arrived before it.
      Daniel observed that this happens frequently enough that Babel ceases to
      work entirely when runner over a WiFi network.
      
      The issue has been described in draft-ietf-babel-mac-relaxed, which is
      currently pending RFC publication. That also describes two mitigation
      mechanisms: Keeping separate PC counters for unicast and multicast, and
      using a reorder window for PC values. This patch implements the former as
      that is the simplest, and resolves the particular issue seen on WiFi.
      
      Thanks to Daniel Gröber for the bugreport.
      
      Minor changes from committer.
      ee919658
    • andi's avatar
      Babel: Implement IPv4 via IPv6 extension (RFC 9229) · eecc3f02
      andi authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      The patch implements an IPv4 via IPv6 extension (RFC 9229) to the Babel
      routing protocol (RFC 8966) that allows annoncing routes to an IPv4
      prefix with an IPv6 next hop, which makes it possible for IPv4 traffic
      to flow through interfaces that have not been assigned an IPv4 address.
      
      The implementation is compatible with the current Babeld version.
      
      Thanks to Toke Høiland-Jørgensen for early review on this work.
      
      Minor changes from committer.
      eecc3f02
  9. Jan 31, 2023
    • Toke Høiland-Jørgensen's avatar
      Babel: Initialise source seqno from incoming message · dc4c5f51
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      When creating a new babel_source object we initialise the seqno to 0. The
      caller will update the source object with the right metric and seqno value,
      for both newly created and old source objects. However if we initialise the
      source object seqno to 0 that may actually turn out to be a valid (higher)
      seqno than the one in the routing table, because of seqno wrapping. In this
      case the source metric will not be set properly, which breaks feasibility
      tracking for subsequent updates.
      
      To fix this, add a new initial_seqno argument to babel_get_source() which
      is used when allocating a new object, and set that to the seqno value of
      the update we're sending.
      
      Thanks to Juliusz Chroboczek for the bugreport.
      dc4c5f51
  10. Jan 30, 2023
  11. Jan 22, 2023
    • Ondřej Zajíček's avatar
      VRF: Fix issues with reconfiguration · a8268369
      Ondřej Zajíček authored
      Protocols receive if_notify() announcements that are filtered according
      to their VRF setting, but during reconfiguration, they access iface_list
      directly and forgot to check VRF setting here, which leads to all
      interfaces be addedd.
      
      Fix this issue for Babel, OSPF, RAdv and RIP protocols.
      
      Thanks to Marcel Menzel for the bugreport.
      a8268369
  12. Jan 03, 2023
    • Ondřej Zajíček's avatar
      Nest: Fix leaking internal attributes in RIP and Babel · b28431e5
      Ondřej Zajíček authored
      During backporting attribute changes from 3.0-branch, some internal
      attributes (RIP iface and Babel seqno) leaked to 'show route all' output.
      Allow protocols to hide specific attributes with GA_HIDDEN value.
      
      Thanks to Nigel Kukard for the bugreport.
      b28431e5
  13. Jan 01, 2023
    • Ondřej Zajíček's avatar
      Nest: Fix several issues with pflags · 6d1ae197
      Ondřej Zajíček authored
      There were some confusion about validity and usage of pflags, which
      caused incorrect usage after some flags from (now removed) protocol-
      specific area were moved to pflags.
      
      We state that pflags:
      
       - Are secondary data used by protocol-specific hooks
       - Can be changed on an existing route (in contrast to copy-on-write
         for primary data)
       - Are irrelevant for propagation (not propagated when changed)
       - Are specific to a routing table (not propagated by pipe)
      
      The patch did these fixes:
      
       - Do not compare pflags in rte_same(), as they may keep cached values
         like BGP_REF_STALE, causing spurious propagation.
      
       - Initialize pflags to zero in rte_get_temp(), avoid initialization in
         protocol code, fixing at least two forgotten initializations (krt
         and one case in babel).
      
       - Improve documentation about pflags
      6d1ae197
  14. Dec 24, 2022
    • Toke Høiland-Jørgensen's avatar
      Babel: Rework seqno request handling · 8b06a4d8
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      The seqno request retransmission handling was tracking the destination
      that a forwarded request was being sent to and always retransmitting to
      that same destination. This is unnecessary because we only need to
      retransmit requests we originate ourselves, not those we forward on
      behalf of others; in fact retransmitting on behalf of others can lead to
      exponential multiplication of requests, which would be bad.
      
      So rework the seqno request tracking so that instead of storing the
      destination of a request, we just track whether it was a request that we
      forwarded on behalf of another node, or if it was a request we originated
      ourselves. Forwarded requests are not retransmitted, they are only used
      for duplicate suppression, and for triggering an update when satisfied.
      If we end up originating a request that we previously forwarded, we
      "upgrade" the old request and restart the retransmit counter.
      
      One complication with this is that requests sent in response to unfeasible
      updates (section 3.8.2.2 of the RFC) have to be sent as unicast to a
      particular peer. However, we don't really need to retransmit those as
      there's no starvation when sending such a request; so we just change
      such requests to be one-off unicast requests that are not subject to
      retransmission or duplicate suppression. This is the same behaviour as
      babeld has for such requests.
      
      Minor changes from committer.
      8b06a4d8
  15. Aug 18, 2022
  16. Jul 22, 2022
  17. Jun 27, 2022
  18. Jun 05, 2022
    • Ondřej Zajíček's avatar
      Babel: Do not try to remove multicast seqno request objects from neighbour list · ad686c55
      Ondřej Zajíček authored
      The Babel seqno request code keeps track of which seqno requests are
      outstanding for a neighbour by putting them onto a per-neighbour list. When
      reusing a seqno request, it will try to remove this node, but if the seqno
      request in question was a multicast request with no neighbour attached this
      will result in a crash because it tries to remove a list node that wasn't
      added to any list.
      
      Fix this by making the list remove conditional. Also fix neighbor removal
      which were changing seqno requests to multicast ones instead of removing
      them.
      
      Fixes: ebd5751c ("Babel: Seqno requests are properly decoupled from
      neighbors when the underlying interface disappears").
      
      Based on the patch from Toke Høiland-Jørgensen <toke@toke.dk>,
      bug reported by Stefan Haller <stefan.haller@stha.de>, thanks.
      ad686c55
  19. Apr 22, 2022
  20. Apr 06, 2022
  21. Feb 27, 2022
  22. Feb 06, 2022
    • 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
  23. Oct 13, 2021
  24. Jun 09, 2021
  25. Jun 06, 2021
    • 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
  26. 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
  27. May 10, 2021
    • Ondřej Zajíček's avatar
      Babel: Log the reason when refusing to run on an interface · c1511b92
      Ondřej Zajíček authored
      The babel protocol code checks whether iface supports multicast, and
      whether it has a link-local address assigned. However, it doesn not give
      any feedback if any of those checks fail, it just silently ignores the
      interface. Fix this by explicitly logging when multicast check fails.
      
      Based on patch from Toke Høiland-Jørgensen, thanks!
      c1511b92
  28. Nov 24, 2020
    • Toke Høiland-Jørgensen's avatar
      lib/slab: introduce sl_allocz() function and use it in Babel · db2d2907
      Toke Høiland-Jørgensen authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      The babel protocol code was initialising objects returned from the slab
      allocator by assigning to each of the struct members individually, but
      wasn't touching the NODE member while doing so. This leads to warnings on
      debug builds since commit:
      
      baac7009 ("List expensive check.")
      
      To fix this, introduce an sl_allocz() variant of the slab allocator which
      will zero out the memory before returning it, and switch all the babel call
      sites to use this version. The overhead for doing this should be negligible
      for small objects, and in the case of babel, the largest object being
      allocated was being zeroed anyway, so we can drop the memset in
      babel_read_tlv().
      db2d2907
  29. Jun 28, 2020
    • Ondřej Zajíček's avatar
      Show info from multiple protocols when protocol is not specified · c26c6bc2
      Ondřej Zajíček authored
      Most commands like 'show ospf neighbors' fail when protocol is not
      specified and there are multiple instances of given protocol type.
      This is annoying in BIRD 2, as many protocols have IPv4 and IPv6
      instances. The patch changes that by showing output from all protocol
      instances of appropriate type.
      
      Note that the patch also removes terminating cli_msg() call from these
      commands and moves it to the common iterating code.
      c26c6bc2
Loading