1. 01 Feb, 2023 3 commits
  2. 31 Jan, 2023 1 commit
    • 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
  3. 30 Jan, 2023 2 commits
  4. 23 Jan, 2023 2 commits
  5. 22 Jan, 2023 3 commits
    • 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
  6. 20 Jan, 2023 1 commit
  7. 18 Jan, 2023 3 commits
    • 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
      6bb992cb
    • 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
  8. 17 Jan, 2023 2 commits
    • 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
  9. 13 Jan, 2023 3 commits
  10. 12 Jan, 2023 1 commit
    • 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
  11. 07 Jan, 2023 1 commit
    • 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
  12. 03 Jan, 2023 3 commits
  13. 02 Jan, 2023 1 commit
  14. 01 Jan, 2023 1 commit
    • 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
  15. 24 Dec, 2022 1 commit
    • 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
  16. 18 Dec, 2022 1 commit
  17. 16 Dec, 2022 3 commits
  18. 11 Dec, 2022 2 commits
  19. 10 Dec, 2022 3 commits
  20. 09 Dec, 2022 3 commits
    • Ondřej Zajíček's avatar
      Doc: Document issue with import tables · e48f898f
      Ondřej Zajíček authored
      The import table does not work reliably together with re-evaluation of
      routes due to recursive next hops or flowspec validation. We will at
      least document that here, as import tables are completely redesigned and
      this issue is fixed in BIRD 3.x branch.
      e48f898f
    • Alexander V. Chernikov's avatar
      Netlink on FreeBSD support · a80cd470
      Alexander V. Chernikov authored and Ondřej Zajíček's avatar Ondřej Zajíček committed
      Netlink support was added to FreeBSD recently. It is not as full-featured
      as its Linux counterpart yet, however the added subset is enough to make
      a routing daemon work. Specifically, it supports multiple tables,
      multipath, nexthops and nexthops groups. No MPLS support yet.
      
      The attached change adds 'bsd-netlink’ sysconf target, allowing to build
      both netlink & rtsock versions on FreeBSD.
      a80cd470
    • Ondřej Zajíček's avatar
      BGP: Improve handling of hold and keepalive timers · 3859e4ef
      Ondřej Zajíček authored
      The effective keepalive time now scales relative to the negotiated
      hold time, to maintain proportion between the keepalive time and the
      hold time. This avoids issues when both keepalive and hold times
      were configured, the hold time was negotiated to a smaller value,
      but the keepalive time stayed the same.
      
      Add new options 'min hold time' and 'min keepalive time', which reject
      session attempts with too small hold time.
      
      Improve validation of config options an their documentation.
      
      Thanks to Alexander Zubkov and Sergei Goriunov for suggestions.
      3859e4ef