Skip to content
Snippets Groups Projects
  1. Apr 21, 2023
  2. Apr 20, 2023
    • Maria Matejka's avatar
      Linpool: Fix lp_restore() · 33540924
      Maria Matejka authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      When lp_save() is called on an empty linpool, then some allocation is
      done, then lp_restore() is called, the linpool is restored but the used
      chunks are inaccessible. Fix it.
      33540924
  3. Apr 14, 2023
  4. Apr 13, 2023
  5. Apr 04, 2023
    • Ondřej Zajíček's avatar
      BGP: Fix bgp_med handling · f881b98d
      Ondřej Zajíček authored
      Missing translation from BGP attribute ID to eattr ID in bgp_unset_attr()
      broke automatic removal of bgp_med during export to EBGP peers.
      
      Thanks to Edward Sun for the bugreport.
      f881b98d
  6. Mar 18, 2023
  7. Mar 16, 2023
    • Maria Matejka's avatar
      BGP: Free bind applies also to outbound connections · 2b712554
      Maria Matejka authored
      Even though the free bind option is primarily meant to alleviate problems
      with addresses assigned too late, it's also possible to use BIRD with AnyIP
      configuration, assigning whole ranges to the machine. Therefore free bind
      allows also to create an outbound connection from specific address even though
      such address is not assigned.
      2b712554
  8. Mar 06, 2023
  9. Feb 22, 2023
    • Maria Matejka's avatar
    • Maria Matejka's avatar
      Linpool flush drops all the allocated pages but one · 6c058ae4
      Maria Matejka authored
      When a linpool is used to allocate a one-off big load of memory, it
      makes no sense to keep that amount of memory for future use inside the
      linpool. Contrary to previous implementations where the memory was
      directly free()d, we now use the page allocator which has an internal
      cache which keeps the released pages for us and subsequent allocations
      simply get these released pages back.
      
      And even if the page cleanup routine kicks in inbetween, the pages get
      only madvise()d, not munmap()ed so performance aspects are negligible.
      
      This may fix some memory usage peaks in extreme cases.
      6c058ae4
  10. Feb 19, 2023
  11. 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
  12. Feb 03, 2023
  13. Feb 01, 2023
  14. 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
  15. Jan 30, 2023
  16. Jan 23, 2023
  17. Jan 22, 2023
    • Ondřej Zajíček's avatar
      BFD: Improve incoming packet matching · 99872676
      Ondřej Zajíček authored
      For active sessions, ignore received packets with zero local id and
      mismatched remote id. That forces a session timeout instead of an
      immediate session restart. It makes BFD sessions more resilient to
      packet spoofing.
      
      Thanks to André Grüneberg for the suggestion.
      99872676
    • 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
    • Maria Matejka's avatar
      3186ffe7
  18. Jan 20, 2023
  19. Jan 18, 2023
    • Ondřej Zajíček's avatar
      Alloc: Minor cleanups · 804916da
      Ondřej Zajíček authored
       - Fix THP disable on old systems
       - Failed syscalls should use die() instead of bug()
       - Our printf uses %ld for s64 instead of long
      804916da
    • Maria Matejka's avatar
    • Maria Matejka's avatar
      Fix memory pre-allocation · 973aa37e
      Maria Matejka authored
      When BIRD has no free memory mapped, it allocates several pages in
      advance just to be sure that there is some memory available if needed.
      This hysteresis tactics works quite well to reduce memory ping-ping with
      kernel.
      
      Yet it had a subtle bug: this pre-allocation didn't take a memory
      coldlist into account, therefore requesting new pages from kernel even
      in cases when there were other pages available. This led to slow memory
      bloating.
      
      To demonstrate this behavior fast enough to be seen well, you may:
        * temporarily set the values in sysdep/unix/alloc.c as follows to
          exacerbate the issue:
            #define KEEP_PAGES_MAIN_MAX    4096
            #define KEEP_PAGES_MAIN_MIN    1000
            #define CLEANUP_PAGES_BULK     4096
        * create a config file with several millions of static routes
        * periodically disable all static protocols and then reload config
        * log memory consumption
      
      This should give you a steady growth rate of about 16kB per cycle. If
      you don't set the values this high, the issue happens much more slowly,
      yet after 14 days of running, you are going to see an OOM kill.
      
      After this fix, pre-allocation uses the memory coldlist to get some hot
      pages and the same test as described here gets you a perfectly stable
      constant memory consumption (after some initial wobbling).
      
      Thanks to NIX-CZ for reporting and helping to investigate this issue.
      Thanks to Santiago for finding the cause in the code.
      973aa37e
  20. Jan 17, 2023
    • rcarpa's avatar
      Filter: Allow setting the 'onlink' route attribute in filters · 7144c9ca
      rcarpa authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Add static route attribute to set onlink flag for route next hop. Can be
      used to build a dynamically routed IP-in-IP overlay network. Usage:
      
           ifname = "tunl0";
           onlink = true;
           gw = bgp_next_hop;
      7144c9ca
    • Ondřej Zajíček's avatar
      Alloc: Disable transparent huge pages · 928a1cb0
      Ondřej Zajíček authored
      The usage pattern implemented in allocator seems to be incompatible with
      transparent huge pages, as memory released using madvise(MADV_DONTNEED)
      with regular page size and alignment does not seem to trigger demotion
      of huge pages back to regular pages, even when significant number of
      pages is released. Even if demotion is triggered when system memory
      is low, it still breaks memory accounting.
      928a1cb0
  21. Jan 13, 2023
  22. Jan 12, 2023
    • Mike Crute's avatar
      Log message before aborting · 64a2b7aa
      Mike Crute authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Log message before aborting due to watchdog timeout. We have to use
      async-safe write to debug log, as it is done in signal handler.
      
      Minor changes from committer.
      64a2b7aa
  23. Jan 07, 2023
    • Ondřej Zajíček's avatar
      Filter: Change linearization of branches in switch instruction · e20bef69
      Ondřej Zajíček authored
      Most branching instructions (FI_CONDITION, FI_AND, FI_OR) linearize its
      branches in a recursive way, while FI_SWITCH branches are linearized
      from parser even before the switch instruction is allocated.
      
      Change linearization of FI_SWITCH branches to make it similar to other
      branching instructions. This also fixes an issue with constant
      switch evaluation, where linearized branch is mistaken for
      non-linearized during switch construction.
      
      Thanks to Jiten Kumar Pathy for the bugreport.
      e20bef69
  24. Jan 03, 2023
Loading