]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
2 years agoThreads take loops faster mq-latency
Maria Matejka [Sun, 7 May 2023 21:40:38 +0000 (23:40 +0200)] 
Threads take loops faster

2 years agofixup! Channel: configurable feed block size
Maria Matejka [Sun, 7 May 2023 21:39:03 +0000 (23:39 +0200)] 
fixup! Channel: configurable feed block size

2 years agoChannel: configurable feed block size
Maria Matejka [Sun, 7 May 2023 21:04:47 +0000 (23:04 +0200)] 
Channel: configurable feed block size

2 years agoBGP: proactively rehash prefix hash up to shorten collision lists
Maria Matejka [Sun, 7 May 2023 19:39:05 +0000 (21:39 +0200)] 
BGP: proactively rehash prefix hash up to shorten collision lists

2 years agoTemporary hash function update
Maria Matejka [Sun, 7 May 2023 19:19:15 +0000 (21:19 +0200)] 
Temporary hash function update

2 years agoOLocks in BGP must be freed early
Maria Matejka [Sun, 7 May 2023 15:30:33 +0000 (17:30 +0200)] 
OLocks in BGP must be freed early

2 years agoIO Loop / Thread Groups Lock moved to level -attrs- to allow for page allocation...
Maria Matejka [Fri, 5 May 2023 18:35:55 +0000 (20:35 +0200)] 
IO Loop / Thread Groups Lock moved to level -attrs- to allow for page allocation while locked

2 years agoFixed loop movement to not collide on LTT_MOVE
Maria Matejka [Fri, 5 May 2023 14:08:50 +0000 (16:08 +0200)] 
Fixed loop movement to not collide on LTT_MOVE

2 years agoFix loop dropping routines
Maria Matejka [Fri, 5 May 2023 13:19:14 +0000 (15:19 +0200)] 
Fix loop dropping routines

2 years agoFixed a bug in hot page global storage
Maria Matejka [Fri, 5 May 2023 07:39:13 +0000 (09:39 +0200)] 
Fixed a bug in hot page global storage

The original algorithm was suffering from an ABA race condition:

A: fp = page_stack
B: completely allocates the same page and writes into it some data
A: unsuspecting, loads (invalid) next = fp->next
B: finishes working with the page and returns it back to page_stack
A: compare-exchange page_stack: fp => next succeeds and writes garbage
to page_stack

Fixed this by using an implicit spinlock in hot page allocator.

2 years agoDebug: keep a circular log of memory page operations
Maria Matejka [Wed, 3 May 2023 17:01:19 +0000 (19:01 +0200)] 
Debug: keep a circular log of memory page operations

2 years agoFixed cold page cache leak
Maria Matejka [Wed, 3 May 2023 16:59:52 +0000 (18:59 +0200)] 
Fixed cold page cache leak

The empty_pages pointer wasn't being propagated into the ->next pointer
when more empty_pages were to be stored

2 years agoHostentry: fix pool locking
Maria Matejka [Mon, 1 May 2023 12:20:27 +0000 (14:20 +0200)] 
Hostentry: fix pool locking

2 years agoLinpool state save and restore refactoring
Maria Matejka [Mon, 1 May 2023 13:10:53 +0000 (15:10 +0200)] 
Linpool state save and restore refactoring

2 years agoDebug: Explicit mprotect() on freed pages to better locate use-after-free bugs
Maria Matejka [Mon, 1 May 2023 12:21:26 +0000 (14:21 +0200)] 
Debug: Explicit mprotect() on freed pages to better locate use-after-free bugs

2 years agoPage allocator: indentation of messy ifdef blocks
Maria Matejka [Wed, 3 May 2023 19:39:36 +0000 (21:39 +0200)] 
Page allocator: indentation of messy ifdef blocks

2 years agoFirst try of loop balancing
Maria Matejka [Sun, 30 Apr 2023 20:17:42 +0000 (22:17 +0200)] 
First try of loop balancing

If a thread encounters timeout == 0 for poll, it considers itself
"busy" and with some hysteresis it tries to drop loops for others to
pick and thus better distribute work between threads.

2 years agoAllocation from linpools and slabs requires the appropriate lock to be taken
Maria Matejka [Fri, 28 Apr 2023 21:48:03 +0000 (23:48 +0200)] 
Allocation from linpools and slabs requires the appropriate lock to be taken

2 years agoLinpool flushes unused pages even on lp_restore()
Maria Matejka [Fri, 28 Apr 2023 10:32:41 +0000 (12:32 +0200)] 
Linpool flushes unused pages even on lp_restore()

2 years agoFixed race condition in hostentry allocation
Maria Matejka [Thu, 27 Apr 2023 10:38:50 +0000 (12:38 +0200)] 
Fixed race condition in hostentry allocation

2 years agoShow threads: Fixed problems with CLI buffer reallocation
Maria Matejka [Thu, 27 Apr 2023 09:02:02 +0000 (11:02 +0200)] 
Show threads: Fixed problems with CLI buffer reallocation

... by allocating all the output locally and then sending it out at
once.

2 years agoExplicitly counting loops and threads
Maria Matejka [Thu, 27 Apr 2023 08:42:11 +0000 (10:42 +0200)] 
Explicitly counting loops and threads

2 years agoLoop spent time refactored to separate structures and functions
Maria Matejka [Wed, 26 Apr 2023 20:24:42 +0000 (22:24 +0200)] 
Loop spent time refactored to separate structures and functions

2 years agoLoops track also locking time
Maria Matejka [Wed, 26 Apr 2023 17:34:29 +0000 (19:34 +0200)] 
Loops track also locking time

2 years agoIO loops now actually measuring their time (show threads all works)
Maria Matejka [Wed, 26 Apr 2023 17:10:52 +0000 (19:10 +0200)] 
IO loops now actually measuring their time (show threads all works)

2 years agoRefactoring of domains connected to pools
Maria Matejka [Mon, 24 Apr 2023 14:10:59 +0000 (16:10 +0200)] 
Refactoring of domains connected to pools

2 years agoFix of failing show threads command
Maria Matejka [Mon, 24 Apr 2023 09:35:05 +0000 (11:35 +0200)] 
Fix of failing show threads command

2 years agoMerge commit 'd61505b039bf0aa6697e28b2a4e07907c89ba1fb' into thread-next
Maria Matejka [Mon, 24 Apr 2023 08:40:53 +0000 (10:40 +0200)] 
Merge commit 'd61505b039bf0aa6697e28b2a4e07907c89ba1fb' into thread-next

2 years agoMerge branch 'mq-resource-locking' into thread-next
Maria Matejka [Mon, 24 Apr 2023 08:39:13 +0000 (10:39 +0200)] 
Merge branch 'mq-resource-locking' into thread-next

2 years agoRemoved duplicate version 3.0-alpha0 news
Maria Matejka [Mon, 24 Apr 2023 08:39:08 +0000 (10:39 +0200)] 
Removed duplicate version 3.0-alpha0 news

2 years agoResource pools are now bound with domains.
Maria Matejka [Fri, 21 Apr 2023 13:26:06 +0000 (15:26 +0200)] 
Resource pools are now bound with domains.

Memory allocation is a fragile part of BIRD and we need checking that
everybody is using the resource pools in an appropriate way. To assure
this, all the resource pools are associated with locking domains and
every resource manipulation is thoroughly checked whether the
appropriate locking domain is locked.

With transitive resource manipulation like resource dumping or mass free
operations, domains are locked and unlocked on the go, thus we require
pool domains to have higher order than their parent to allow for this
transitive operations.

Adding pool locking revealed some cases of insecure memory manipulation
and this commit fixes that as well.

2 years agoProtocols and tables now use the birdloop pools as primary
Maria Matejka [Sat, 22 Apr 2023 19:20:19 +0000 (21:20 +0200)] 
Protocols and tables now use the birdloop pools as primary

2 years agoResource pool closing has its dedicated function
Maria Matejka [Thu, 20 Apr 2023 19:08:38 +0000 (21:08 +0200)] 
Resource pool closing has its dedicated function

2 years agoSocket closing has its dedicated function
Maria Matejka [Thu, 20 Apr 2023 19:06:42 +0000 (21:06 +0200)] 
Socket closing has its dedicated function

2 years agoGlobal protocol list is typed to avoid typecast confusion
Maria Matejka [Wed, 19 Apr 2023 19:18:12 +0000 (21:18 +0200)] 
Global protocol list is typed to avoid typecast confusion

2 years agoTyped lists: added add_after() and unit tests
Maria Matejka [Wed, 19 Apr 2023 19:02:20 +0000 (21:02 +0200)] 
Typed lists: added add_after() and unit tests

2 years agoAlpha0 news added v3.0-alpha1
Ondrej Filip [Fri, 21 Apr 2023 07:08:54 +0000 (09:08 +0200)] 
Alpha0 news added

2 years agoBSD: IPv4 over IPv6 nexthop support on FreeBSD
Luiz Amaral [Thu, 20 Apr 2023 23:37:30 +0000 (01:37 +0200)] 
BSD: IPv4 over IPv6 nexthop support on FreeBSD

The support for IPv4 routes with IPv6 nexthops was implemented in FreeBSD
13.1, this patch allows to import and export such routes from/to kernel.

Minor change from committer.

2 years agoLinpool: Fix lp_restore()
Maria Matejka [Thu, 20 Apr 2023 17:33:00 +0000 (19:33 +0200)] 
Linpool: Fix lp_restore()

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.

2 years agoTyped lists keep an explicit pointer to the list head.
Maria Matejka [Wed, 19 Apr 2023 15:52:52 +0000 (17:52 +0200)] 
Typed lists keep an explicit pointer to the list head.

This change adds one pointer worth of memory to every list node.
Keeping this information helps auditing the lists, checking that the
node indeed is outside of list or inside the right one.

The typed lists shouldn't be used anywhere with memory pressure anyway,
thus the one added pointer isn't significant.

2 years agoUpdated the version number to not include dash (breaks RPM)
Maria Matejka [Tue, 18 Apr 2023 08:11:07 +0000 (10:11 +0200)] 
Updated the version number to not include dash (breaks RPM)

2 years agoNEWS and version update
Maria Matejka [Tue, 18 Apr 2023 07:52:12 +0000 (09:52 +0200)] 
NEWS and version update

2 years agoMerge tag '3.0-alpha0' into HEAD
Maria Matejka [Tue, 18 Apr 2023 07:43:06 +0000 (09:43 +0200)] 
Merge tag '3.0-alpha0' into HEAD

3.0-alpha0

2 years agoIO: added a specific loop pickup group for BFD; to be done better in future
Maria Matejka [Mon, 17 Apr 2023 09:37:29 +0000 (11:37 +0200)] 
IO: added a specific loop pickup group for BFD; to be done better in future

2 years agoMerge commit '9e44ace3' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 13:18:18 +0000 (15:18 +0200)] 
Merge commit '9e44ace3' into thread-next-iface

2 years agoMerge commit 'f881b98d' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 12:30:48 +0000 (14:30 +0200)] 
Merge commit 'f881b98d' into thread-next-iface

2 years agoMerge commit '231c6385' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 12:00:54 +0000 (14:00 +0200)] 
Merge commit '231c6385' into thread-next-iface

2 years agoMerge commit '2f080b54' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 11:59:23 +0000 (13:59 +0200)] 
Merge commit '2f080b54' into thread-next-iface

2 years agoMerge commit '6c058ae4' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 11:43:32 +0000 (13:43 +0200)] 
Merge commit '6c058ae4' into thread-next-iface

2 years agoMerge commit '913ec57f' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 11:43:24 +0000 (13:43 +0200)] 
Merge commit '913ec57f' into thread-next-iface

2 years agoMerge commit 'ee919658' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 11:42:42 +0000 (13:42 +0200)] 
Merge commit 'ee919658' into thread-next-iface

2 years agoMerge commit '0851fcde' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 09:37:23 +0000 (11:37 +0200)] 
Merge commit '0851fcde' into thread-next-iface

2 years agoMerge commit 'dc4c5f51' into thread-next-iface
Maria Matejka [Fri, 14 Apr 2023 09:32:20 +0000 (11:32 +0200)] 
Merge commit 'dc4c5f51' into thread-next-iface

2 years agoBGP: Add 'allow bgp_med' option for EBGP sessions
Trisha Biswas [Fri, 14 Apr 2023 02:28:37 +0000 (04:28 +0200)] 
BGP: Add 'allow bgp_med' option for EBGP sessions

This option allows to treat bgp_med as regular transitive attribute
on EBGP sessions (without hacks in filters).

Minor changes from committer.

2 years agoIncrease tests timeout
Jakub Ružička [Thu, 13 Apr 2023 18:06:55 +0000 (20:06 +0200)] 
Increase tests timeout

Tests may take longer than 5 s to complete on slow/virtual machines.

2 years agoTemporarily disable MRT as it still lacks proper locking; to be re-enabled in 3.0...
Maria Matejka [Wed, 12 Apr 2023 16:42:59 +0000 (18:42 +0200)] 
Temporarily disable MRT as it still lacks proper locking; to be re-enabled in 3.0-alpha2

2 years agoLoop: keep running the same loop for some time if there is work to do
Maria Matejka [Thu, 6 Apr 2023 18:18:04 +0000 (20:18 +0200)] 
Loop: keep running the same loop for some time if there is work to do

2 years agoBFD: fixed a request pickup race condition
Maria Matejka [Wed, 5 Apr 2023 19:59:01 +0000 (21:59 +0200)] 
BFD: fixed a request pickup race condition

When several BGPs requested a BFD session in short time, chances were
that the second BGP would file a request while the pickup routine was
still running and it would get enqueued into the waiting list instead of
being picked up.

Fixed this by enforcing pickup loop restart when new requests got added,
and also by atomically moving the unpicked requests to a temporary list
to announce admin down before actually being added into the wait list.

2 years agoBGP: set free bind also for connect sockets if configured
Maria Matejka [Mon, 6 Mar 2023 19:00:01 +0000 (20:00 +0100)] 
BGP: set free bind also for connect sockets if configured

2 years agoBGP: sockets use sk_resume_rx and sk_pause_rx
Maria Matejka [Sun, 2 Apr 2023 17:15:27 +0000 (19:15 +0200)] 
BGP: sockets use sk_resume_rx and sk_pause_rx

2 years agoBGP now has its own loop
Maria Matejka [Sun, 2 Apr 2023 17:35:35 +0000 (19:35 +0200)] 
BGP now has its own loop

2 years agoSockets: Unified API for main and other loops
Maria Matejka [Sun, 2 Apr 2023 17:15:22 +0000 (19:15 +0200)] 
Sockets: Unified API for main and other loops

Now sk_open() requires an explicit IO loop to open the socket in. Also
specific functions for socket RX pause / resume are added to allow for
BGP corking.

And last but not least, socket reloop is now synchronous to resolve
weird cases of the target loop stopping before actually picking up the
relooped socket. Now the caller must ensure that both loops are locked
while relooping, and this way all sockets always have their respective
loop.

2 years agoMore efficient IO loop event execution to avoid long loops
Maria Matejka [Fri, 24 Feb 2023 08:13:35 +0000 (09:13 +0100)] 
More efficient IO loop event execution to avoid long loops

If there are lots of loops in a single thread and only some of the loops
are actually active, the other loops are now kept aside and not checked
until they actually get some timers, events or active sockets.

This should help with extreme loads like 100k tables and protocols.

Also ping and loop pickup mechanism was allowing subtle race
conditions. Now properly handling collisions between loop ping and pickup.

2 years agoResource dumps also write out block addresses
Maria Matejka [Tue, 28 Feb 2023 09:42:47 +0000 (10:42 +0100)] 
Resource dumps also write out block addresses

2 years agoLinpool: State restoration works in initial linpool state
Maria Matejka [Tue, 28 Feb 2023 14:19:21 +0000 (15:19 +0100)] 
Linpool: State restoration works in initial linpool state

2 years agoMisc allocator fixes
Maria Matejka [Tue, 28 Feb 2023 14:23:48 +0000 (15:23 +0100)] 
Misc allocator fixes

2 years agoAllocator fix: thread local kept pages counter must be thread local
Maria Matejka [Mon, 27 Feb 2023 18:12:29 +0000 (19:12 +0100)] 
Allocator fix: thread local kept pages counter must be thread local

2 years agoRoute feed marks only the relevant pending exports as done
Maria Matejka [Fri, 31 Mar 2023 08:46:17 +0000 (10:46 +0200)] 
Route feed marks only the relevant pending exports as done

2 years agoPropagated const through route feed routines
Maria Matejka [Thu, 30 Mar 2023 09:37:16 +0000 (11:37 +0200)] 
Propagated const through route feed routines

2 years agoMoved channel export hooks to rt.h as the channel refactoring isn't going to take...
Maria Matejka [Thu, 30 Mar 2023 08:34:28 +0000 (10:34 +0200)] 
Moved channel export hooks to rt.h as the channel refactoring isn't going to take place soon

2 years agoAllowing to restart a route refresh.
Maria Matejka [Sun, 19 Mar 2023 12:21:35 +0000 (13:21 +0100)] 
Allowing to restart a route refresh.

Repeated pipe refeed should not end route refresh as the prune routine
may start pruning otherwise valid routes.

The same applies for BGP repeated route refresh.

2 years agoFixed default table configuration
Maria Matejka [Thu, 9 Mar 2023 15:34:17 +0000 (16:34 +0100)] 
Fixed default table configuration

When changing default table behavior, I missed that it enabled to
configure multiple master4 and master6 tables. Now BIRD recognizes it
and fails properly.

2 years agoFixed use-after-free of old protocol name pointer copied into rte_owner structure
Maria Matejka [Wed, 8 Mar 2023 12:47:42 +0000 (13:47 +0100)] 
Fixed use-after-free of old protocol name pointer copied into rte_owner structure

2 years agoFixed unwanted reloads while reconfiguring protocols with import table on
Maria Matejka [Wed, 8 Mar 2023 12:44:18 +0000 (13:44 +0100)] 
Fixed unwanted reloads while reconfiguring protocols with import table on

2 years agoFixed bad filter re-evaluation with import table if filtered->accepted
Maria Matejka [Wed, 8 Mar 2023 20:38:18 +0000 (21:38 +0100)] 
Fixed bad filter re-evaluation with import table if filtered->accepted

The import table feed wasn't resetting the table-specific route values
like REF_FILTERED and thus made the route look like filtered even though
it should have been re-evaluated as accepted.

2 years agoFixed channel stopping when reload is active
Maria Matejka [Tue, 7 Mar 2023 22:22:03 +0000 (23:22 +0100)] 
Fixed channel stopping when reload is active

2 years agoFix obvious mistake in protocol debug dump
Maria Matejka [Mon, 6 Mar 2023 18:28:08 +0000 (19:28 +0100)] 
Fix obvious mistake in protocol debug dump

2 years agoFixed stopping of import request with no imports in idle table
Maria Matejka [Thu, 2 Mar 2023 10:48:17 +0000 (11:48 +0100)] 
Fixed stopping of import request with no imports in idle table

2 years agoMoved table hostcache updater to table service routines to not bother the mainloop
Maria Matejka [Mon, 6 Mar 2023 12:16:12 +0000 (13:16 +0100)] 
Moved table hostcache updater to table service routines to not bother the mainloop

2 years agoReducing initial channel bitmap sizes to help extreme cases
Maria Matejka [Mon, 27 Feb 2023 21:03:41 +0000 (22:03 +0100)] 
Reducing initial channel bitmap sizes to help extreme cases

2 years agoFlowspec links must have the destination table service loop locked
Maria Matejka [Tue, 7 Feb 2023 16:01:34 +0000 (17:01 +0100)] 
Flowspec links must have the destination table service loop locked

2 years agoBGP Export Table: Fixed route source objects leaking when prefix best routes is updated
Maria Matejka [Wed, 8 Mar 2023 18:28:31 +0000 (19:28 +0100)] 
BGP Export Table: Fixed route source objects leaking when prefix best routes is updated

2 years agoBGP: LLGR Staleness optimization dropped.
Maria Matejka [Wed, 29 Mar 2023 16:55:46 +0000 (18:55 +0200)] 
BGP: LLGR Staleness optimization dropped.

This brought unnecessary complexity into the decision procedures while the
performance aspects weren't worth it. It just saved one ea_list traversal
when many others are also done.

2 years agoBGP: show detailed TX state in show proto all output
Maria Matejka [Sun, 5 Mar 2023 15:22:55 +0000 (16:22 +0100)] 
BGP: show detailed TX state in show proto all output

2 years agoBFD notifications respect protocol loop settings
Maria Matejka [Tue, 7 Feb 2023 14:14:40 +0000 (15:14 +0100)] 
BFD notifications respect protocol loop settings

2 years agoTemporarily switching off time annotations of debug log
Maria Matejka [Thu, 9 Mar 2023 15:32:20 +0000 (16:32 +0100)] 
Temporarily switching off time annotations of debug log

The "dump *" commands are totally garbled by the time annotations.

2 years agoConf: Fix too early free of old configuration
Ondrej Zajicek [Sun, 19 Feb 2023 02:59:10 +0000 (03:59 +0100)] 
Conf: Fix too early free of old configuration

The change 371eb49043d225d2bab8149187b813a14b4b86d2 introduced early free
of old_config. Unfortunately, it did not properly check whether it is not
still in use (blocked by obstacle during reconfiguration). Fix that.

It also means that we still could have a short peak when three configs
are in use (when a new reconfig is requeste while the previous one is
still active).

2 years agoInterface subsystem locking
Maria Matejka [Tue, 4 Apr 2023 14:41:55 +0000 (16:41 +0200)] 
Interface subsystem locking

2 years agoProto: published protocol-loop connections
Maria Matejka [Sun, 2 Apr 2023 17:34:22 +0000 (19:34 +0200)] 
Proto: published protocol-loop connections

2 years agoBGP: Fix bgp_med handling
Ondrej Zajicek [Tue, 4 Apr 2023 03:20:49 +0000 (05:20 +0200)] 
BGP: Fix bgp_med handling

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.

2 years agoAdd missing references to "show route in" in the cli-help and doc.
Johannes Moos [Sat, 18 Mar 2023 14:33:48 +0000 (15:33 +0100)] 
Add missing references to "show route in" in the cli-help and doc.

The feature of showing all prefixes inside the given one has been added
in v2.0.9 but not well documented. Fixing it by this update.

Text in doc and commit message added by commiter.

2 years agoBGP: Free bind applies also to outbound connections
Maria Matejka [Thu, 16 Mar 2023 18:23:19 +0000 (19:23 +0100)] 
BGP: Free bind applies also to outbound connections

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.

2 years agoNet: Replace runtime checks with STATIC_ASSERT()
Ondrej Zajicek [Mon, 6 Mar 2023 10:57:40 +0000 (11:57 +0100)] 
Net: Replace runtime checks with STATIC_ASSERT()

2 years agoPrintf test suite fails on systems with musl libc because tests for "%m"
Petr Vaněk [Mon, 6 Mar 2023 10:19:30 +0000 (11:19 +0100)] 
Printf test suite fails on systems with musl libc because tests for "%m"
and "%M" formats expect "Input/output error" message but musl returns
"I/O error". Proposed change compares the printf output with string
returned from strerror function for EIO constant.

See-also: https://bugs.gentoo.org/836713

Minor change from committer.

2 years agoConfig: Dropping filter instruction trees after linearization
Maria Matejka [Thu, 16 Feb 2023 13:22:23 +0000 (14:22 +0100)] 
Config: Dropping filter instruction trees after linearization

2 years agoLinpool flush drops all the allocated pages but one
Maria Matejka [Wed, 22 Feb 2023 13:45:20 +0000 (14:45 +0100)] 
Linpool flush drops all the allocated pages but one

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.

2 years agoBGP: Update RFC references
Ondrej Zajicek [Sun, 19 Feb 2023 14:35:07 +0000 (15:35 +0100)] 
BGP: Update RFC references

2 years agoBabel: Update RFC references
Ondrej Zajicek [Sun, 19 Feb 2023 14:34:43 +0000 (15:34 +0100)] 
Babel: Update RFC references

2 years agoConf: Fix too early free of old configuration
Ondrej Zajicek [Sun, 19 Feb 2023 02:59:10 +0000 (03:59 +0100)] 
Conf: Fix too early free of old configuration

The change 371eb49043d225d2bab8149187b813a14b4b86d2 introduced early free
of old_config. Unfortunately, it did not properly check whether it is not
still in use (blocked by obstacle during reconfiguration). Fix that.

It also means that we still could have a short peak when three configs
are in use (when a new reconfig is requeste while the previous one is
still active).

2 years agoBabel: Keep separate auth PC counters for unicast and multicast
Toke Høiland-Jørgensen [Tue, 14 Feb 2023 17:18:32 +0000 (18:18 +0100)] 
Babel: Keep separate auth PC counters for unicast and multicast

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.