]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
13 days agoNEWS and version update stable-v3.0 v3.0.5
Maria Matejka [Mon, 22 Sep 2025 11:55:18 +0000 (13:55 +0200)] 
NEWS and version update

13 days agoBGP: Fixed crash on Notification with a message
Maria Matejka [Thu, 18 Sep 2025 16:01:37 +0000 (18:01 +0200)] 
BGP: Fixed crash on Notification with a message

Due to wrong locking order, when a peer with an established BGP
session sent a Notification with a custom message, BIRD always
crashed when trying to allocate the memory for that message.

This is a minimal crashfix for stable branches; the development
branch will get a more systematic protocol allocation rework.

Reported-By: Rob Lister <rob@lonap.net>
13 days agoCI: Ubuntu 24.10 is EOL, 25.04 is current
Maria Matejka [Mon, 22 Sep 2025 15:37:05 +0000 (17:37 +0200)] 
CI: Ubuntu 24.10 is EOL, 25.04 is current

13 days agoPipe: Do not show statistics for a stopping pipe
Maria Matejka [Mon, 22 Sep 2025 09:17:34 +0000 (11:17 +0200)] 
Pipe: Do not show statistics for a stopping pipe

There is no guarantee of such statistics to exist.

Reported-By: NIX-CZ
13 days agoBGP: Fixed invalid memory access in pending TX flush
Maria Matejka [Mon, 22 Sep 2025 08:37:16 +0000 (10:37 +0200)] 
BGP: Fixed invalid memory access in pending TX flush

When BGP is shutting down (or graceful-restarting), it must flush the
pending TX data. In quite rare cases, it may have happened that with the
export table on and shutting down a session with just the right amount
of unsent updates, the flush may have caused a step-down of the prefix
hash in the middle of walking it.

Usually, when downsizing, the prefix of the allocated block is used, but
if the block is large enough, it may have been re-used by another thread
early enough to cause some very unwanted out-of-buffer access.

Reported-By: NIX-CZ
13 days agoHash: Assert that table is not resized during HASH_WALK
Igor Putovny [Wed, 11 Jun 2025 15:44:38 +0000 (17:44 +0200)] 
Hash: Assert that table is not resized during HASH_WALK

According to measurements of hash_test, hash table with this assertion added
was not found to be significantly slower than without it on average. Therefore
we conclude that this addition would not hamper the performance of HASH_WALK.

13 days agoHash: fix buffer overflow in unit test
Igor Putovny [Wed, 11 Jun 2025 10:00:23 +0000 (12:00 +0200)] 
Hash: fix buffer overflow in unit test

This bug manifested itself as segmentation fault of t_insert2_find test when
TEST_ORDER was increased from 13 to 14. When checking the validity of filled
table, the table is iterated from 0 to MAX_NUM. However, when order is an even
number, the size of the table is lower than MAX_NUM (due to table resizing),
which caused reading beyond the allocated memory.

This bug does not apply to BIRD itself.

13 days agoROA Aggregator: Fix crash on multiwithdraw
Maria Matejka [Tue, 16 Sep 2025 10:04:21 +0000 (12:04 +0200)] 
ROA Aggregator: Fix crash on multiwithdraw

Theoretically, multiple withdraw from the best feed should never happen
but apparently there is an opportunity. We are unable to reproduce that
but it's obvious that with the old code, if the last ROA to remove is at
the end of the list, an undefined memory is checked. If it accidentally
matches (which seems to be pretty rare), BIRD may call memcpy() with
a negative length and subsequently crash on segfault.

Reported-By: NIX-CZ
13 days agoProtocol: State announcements must be always processed before leaving the loop
Katerina Kubecova [Thu, 18 Sep 2025 09:21:41 +0000 (11:21 +0200)] 
Protocol: State announcements must be always processed before leaving the loop

When using PROTO_LOCKED_FROM_MAIN or other birdloop_enter, there may be
deferred state announcements which have to be sent immediately,
otherwise the main loop would try to execute them out of the appropriate
locked context.

13 days agoProto: deferring start from proto_enable
Maria Matejka [Thu, 18 Sep 2025 10:43:44 +0000 (12:43 +0200)] 
Proto: deferring start from proto_enable

When the enable command is issued from CLI, we actually do not need
to enable the protocol right away, it's enough to run the rethink goal
function later from a deferred context. This allows us to change the
protocol's loop safely.

13 days agoBGP: Fixing an unlikely situation, when listening socket is created too late.
Katerina Kubecova [Thu, 4 Sep 2025 08:56:44 +0000 (10:56 +0200)] 
BGP: Fixing an unlikely situation, when listening socket is created too late.

closes #298

13 days agoCI: Add test of user and groups before and after package installation
David Petera [Wed, 20 Aug 2025 14:45:06 +0000 (16:45 +0200)] 
CI: Add test of user and groups before and after package installation

Also fix typo and add more descriptive logging to installation test

13 days agoCI: Add debian trixie to pipeline
David Petera [Tue, 19 Aug 2025 16:05:22 +0000 (18:05 +0200)] 
CI: Add debian trixie to pipeline

13 days agoCI: Fix installation on newer debian-based distros
David Petera [Wed, 20 Aug 2025 16:04:37 +0000 (18:04 +0200)] 
CI: Fix installation on newer debian-based distros

Package 'adduser' needs to be installed explicitly

13 days agoCI: Limit log bloating for netlab runners
Maria Matejka [Thu, 19 Jun 2025 19:12:52 +0000 (21:12 +0200)] 
CI: Limit log bloating for netlab runners

There is no useful configurable file size limit for netlab, allowing
the job to eat up all the disk. Thus we limit it directly in the script
by setting ulimit -f to 1G.

13 days agoCI: Fix tests for merge requests
Maria Matejka [Thu, 12 Jun 2025 09:55:21 +0000 (11:55 +0200)] 
CI: Fix tests for merge requests

The branch name check needed to be extended to include merge requests.
Now for merge requests, we generate a fake branch name.

13 days agoCI: Fix netlab failure artifact collection
Maria Matejka [Thu, 12 Jun 2025 09:52:32 +0000 (11:52 +0200)] 
CI: Fix netlab failure artifact collection

When implementing artifact collection for netlab,
I forgot that the coredumps and logs are generated outside the
repository. Moving the artifacts to the right place for collection.

Introduced in 3d88a81f102783bd4af3d99db1e1f14d14050d6c.

13 days agoCI: Note on how to trigger image rebuild when adding new dockerfile.
Jana Babovakova [Tue, 27 May 2025 10:42:13 +0000 (12:42 +0200)] 
CI: Note on how to trigger image rebuild when adding new dockerfile.

13 days agoCI: Added Docker for Rocky Linux 8 and 9.
Jana Babovakova [Tue, 27 May 2025 10:34:45 +0000 (12:34 +0200)] 
CI: Added Docker for Rocky Linux 8 and 9.

Updated both to supported versions 8.10, 9.5.

4 months agoNEWS and version update v3.0.4
Maria Matejka [Mon, 26 May 2025 19:06:31 +0000 (21:06 +0200)] 
NEWS and version update

4 months agoTable: Do not attempt to prune an empty table
Maria Matejka [Sat, 24 May 2025 12:16:44 +0000 (14:16 +0200)] 
Table: Do not attempt to prune an empty table

Table pruning is requested from multiple places, including
a timer. Sometimes this may happen in a race condition with
table shutdown, and therefore we explicitly refuse to schedule
pruning if the table is empty.

Also added a full-blown check that a shutting-down table
is indeed empty, and several more asserts to catch imminent crashes
before they happen in hard-to-debug places.

This fixes #254.

4 months agoShutdown: Do not export routes
Maria Matejka [Fri, 23 May 2025 18:40:22 +0000 (20:40 +0200)] 
Shutdown: Do not export routes

When shutting down, the tables start flushing routes before all protocols
are even officially aware of the shutdown. This fix allows for a fast check
whether the shutdown is already running or not, and if so, all exports are
ignored instead of processing them.

One notable exception is the kernel protocol which needs to process all
the exports normally to actually withdraw the routes.

This is a hotfix for #251 and #252. Proper fix will require protocol
state machine refactoring.

4 months agoTable: fix a race condition in export
Maria Matejka [Fri, 23 May 2025 17:17:53 +0000 (19:17 +0200)] 
Table: fix a race condition in export

The race condition happens as follows:

- channel A starts feeding
- channel B imports a route ahead of the feeding pointer
- channel A exports this route and continues feeding from the pointer
- no other import hits this specific prefix
- there is at least one channel C which has not cleared this export
- channel A computes ecnt=0 for this prefix because all exports
  have been already cleared
- the condition e >= ecnt mistakenly triggers retry

If the birdloops involved get assigned to the same thread, this race
condition then can't recover and the thread is stuck in an infinite
loop.

Fixed the race condition by moving the consistency check after actually
checking eligibility of the export, not before.

Found by randomly observing performance tests.

4 months agoASPA: fix the table subscription
Maria Matejka [Wed, 21 May 2025 11:11:10 +0000 (13:11 +0200)] 
ASPA: fix the table subscription

With the partial reloads of ROA, the ASPA reload must be different.
When merging ASPA from 2.16, we forgot about that, and the ROA digesting
procedures simply do not work with ASPA, so we instead re-add the settle
timer back.

This fixes #237.

4 months agoASPA: fix aspa_check_upstream and aspa_check_downstream parse crash
Maria Matejka [Wed, 21 May 2025 11:53:35 +0000 (13:53 +0200)] 
ASPA: fix aspa_check_upstream and aspa_check_downstream parse crash

Due to internal differences between BIRD 2 and 3, there is
FI_CURRENT_ROUTE in BIRD 3 and `val.rte == NULL` is not supported
as a shortcut for fetching the route object.

When merging, we forgot to fix this difference in the BGP config parser,
thus the constant folder failed to recognize that this is not a constant
expression, leading to accidentally dereference the NULL route pointer
in config parse time.

This fixes #247.

4 months agoBGP: fix warnings for roa_check() with no import table and route refresh on
Maria Matejka [Wed, 21 May 2025 09:06:01 +0000 (11:06 +0200)] 
BGP: fix warnings for roa_check() with no import table and route refresh on

When roa_check() appears in import filters, the autoreload is switched
on but prohibited for BGP if no import table is available. By fixing the
route refresh feature in 9edc421148fe9c5e7d6038b667ba8fafb587a1eb, we
inadvertently exposed another bug where Nest wasn't distinguishing
between locally and remotely available reload.

Whereas on manual reconfiguration, the route refresh is expected to be
invoked, the autoreload should not trigger any remote actions. Therefore
now the channels actualy indicate whether their reload hook triggers
remote actions or not. This information can be then used to decide
whether to allow autoreload or not.

4 months agoAll events are required to have their hook
Maria Matejka [Wed, 21 May 2025 08:15:49 +0000 (10:15 +0200)] 
All events are required to have their hook

This is quite an obvious requirement but it wasn't enforced properly,
leading to unnecessarily tedious debugging when an uninitialized event
is improperly enqueued.

Now BIRD is going to crash as soon as somebody tries to enqueue such
an event, not when trying to execute nothing from a clean context.

Would have helped with #238.

4 months agoMRT: Fix typo in assert
Katerina Kubecova [Tue, 13 May 2025 08:43:17 +0000 (10:43 +0200)] 
MRT: Fix typo in assert

In mrt_cli_dump_done, BIRD 3 always crashed because the assert could
never be true by a typo.

4 months agoLogs: Reset found_old flags in struct log_config
Katerina Kubecova [Mon, 12 May 2025 14:43:36 +0000 (16:43 +0200)] 
Logs: Reset found_old flags in struct log_config

When recycling an existing configuration (configure undo), the found_old
flags were already set. Due to this oversight, log files failed to
reopen on configure undo.

This fixes #188.

4 months agoCI: Add package install tests.
David Petera [Wed, 7 May 2025 14:02:09 +0000 (16:02 +0200)] 
CI: Add package install tests.

We are checking that generated BIRD packages can be installed and run.
Communication between bird and birdc is also tested.

This fixes #202

4 months agoCI: added new ASPA tests.
Jana Babovakova [Fri, 23 May 2025 10:19:59 +0000 (12:19 +0200)] 
CI: added new ASPA tests.

4 months agoGitlab: fix cleanup after failed netlab
Maria Matejka [Thu, 22 May 2025 15:57:00 +0000 (17:57 +0200)] 
Gitlab: fix cleanup after failed netlab

I forgot to add cd command to move to the right directory.

4 months agoCI: Stayrtr binary has moved elsewhere
Maria Matejka [Thu, 22 May 2025 15:21:13 +0000 (17:21 +0200)] 
CI: Stayrtr binary has moved elsewhere

Installed our local version supporting RTRv2 and ASPA

4 months agoGitlab: properly cleanup after failed netlab jobs
Maria Matejka [Sat, 10 May 2025 18:17:34 +0000 (20:17 +0200)] 
Gitlab: properly cleanup after failed netlab jobs

Also keeps artifacts from failed netlab jobs to allow for
easier debugging

4 months agoNEWS and version update v3.0.3
Maria Matejka [Tue, 13 May 2025 15:34:40 +0000 (17:34 +0200)] 
NEWS and version update

4 months agoMakefile: Fix accidentally added dry-run markers
Maria Matejka [Tue, 13 May 2025 13:47:06 +0000 (15:47 +0200)] 
Makefile: Fix accidentally added dry-run markers

4 months agoCI: Add systemd installation to Fedora Dockerfiles and make exception in bird.spec...
David Petera [Wed, 7 May 2025 13:36:14 +0000 (15:36 +0200)] 
CI: Add systemd installation to Fedora Dockerfiles and make exception in bird.spec for CentOS and OpenSUSE distros.

4 months agoBGP: end of feeding MPLS channel must not try to schedule a packet
Maria Matejka [Sat, 10 May 2025 21:35:03 +0000 (23:35 +0200)] 
BGP: end of feeding MPLS channel must not try to schedule a packet

This caused a invalid memory use when reloading MPLS channels,
occasionally forcing BIRD to an endless loop due to invalid flag
in channel map.

4 months agoConf: Fix invalid check in text_or_ipa grammar
Ondrej Zajicek [Tue, 6 May 2025 12:50:53 +0000 (14:50 +0200)] 
Conf: Fix invalid check in text_or_ipa grammar

Can cause crash when a bad expression is used.

4 months agoBFD: Fix missing keyword declarations
Ondrej Zajicek [Wed, 8 Jan 2025 23:30:37 +0000 (00:30 +0100)] 
BFD: Fix missing keyword declarations

Some keywords were missing for BFD-only build.

4 months agoFixed several tests which needed static protocol
Maria Matejka [Tue, 3 Dec 2024 19:08:30 +0000 (20:08 +0100)] 
Fixed several tests which needed static protocol

Now they need device protocol which is always built.

4 months agoDisabling filter test unless needed protocols are configured
Maria Matejka [Tue, 3 Dec 2024 19:08:23 +0000 (20:08 +0100)] 
Disabling filter test unless needed protocols are configured

4 months agoFix build for CentOS 7
Maria Matejka [Sat, 10 May 2025 14:29:18 +0000 (16:29 +0200)] 
Fix build for CentOS 7

Partial cherry-pick of commit 913a9cad574f70acf3d7e5c6293c4bbe27b73074

Co-Authored-By: David Petera <david.petera@nic.cz>
4 months agoDisable LTO for NetBSD. It crashes the compiler for whatever reason.
Igor Putovny [Fri, 9 May 2025 17:59:40 +0000 (19:59 +0200)] 
Disable LTO for NetBSD. It crashes the compiler for whatever reason.

4 months agoAdd configure option to independently enable/disable link-time optimization
Igor Putovny [Fri, 9 May 2025 17:56:24 +0000 (19:56 +0200)] 
Add configure option to independently enable/disable link-time optimization

4 months agoBSD: Fix build on NetBSD
Ondrej Zajicek [Fri, 25 Apr 2025 16:29:28 +0000 (18:29 +0200)] 
BSD: Fix build on NetBSD

Newer NetBSD versions removed RTF_LLINFO and added RTF_LLDATA.
In FreeBSD, RTF_LLINFO is obsolete, but still defined.

4 months agoDocs: added information about difference in export table usage on v2/3.
Jana Babovakova [Fri, 9 May 2025 14:40:34 +0000 (16:40 +0200)] 
Docs: added information about difference in export table usage on v2/3.

4 months agoBGP: Fix repeated route refresh request
Maria Matejka [Thu, 8 May 2025 21:03:57 +0000 (23:03 +0200)] 
BGP: Fix repeated route refresh request

The previous approach was crashing on rapid successions of route refreshs
without even completing the previous ones. Now the newly requested refreshs
just queue and don't start multiple refreshs over and over again.

4 months agoBGP: Fix route refresh behavior
Igor Putovny [Mon, 5 May 2025 13:47:10 +0000 (15:47 +0200)] 
BGP: Fix route refresh behavior

On import filter reconfiguration, the route refresh capability is now
honored and used instead of restarting the session.

On export filter reconfiguration, the enhanced route refresh capability
is used to indicate BoRR and EoRR, unless the export table is on. In
such cases, only relevant changes are sent as proper updates.

When route refresh request is received, the enhanced route refresh
capability is now honored.

Co-Authored-By: Maria Matejka <mq@ucw.cz>
4 months agoBGP: Fix reconfiguration of import behavior modifiers
Maria Matejka [Tue, 6 May 2025 17:54:11 +0000 (19:54 +0200)] 
BGP: Fix reconfiguration of import behavior modifiers

In case of aigp, gw mode and cost change, we need to reload routes
from the peer, and do that forcibly even if import table is on.

4 months agoNetlink: Fix fix BSD error
Maria Matejka [Tue, 6 May 2025 16:30:39 +0000 (18:30 +0200)] 
Netlink: Fix fix BSD error

There was a typo in the previous commit, -> instead of .

4 months agoNetlink: Fix BSD build error
Katerina Kubecova [Tue, 22 Apr 2025 08:41:06 +0000 (10:41 +0200)] 
Netlink: Fix BSD build error

Due to missing autotests, we forgot to catch this place in Netlink code
which builds only for FreeBSD and not for Linux.

Caused by incomplete merge from master.

4 months agoBackported release tooling updates from 3.1 and 2.17
Maria Matejka [Thu, 8 May 2025 20:26:17 +0000 (22:26 +0200)] 
Backported release tooling updates from 3.1 and 2.17

4 months agoDoc: building singlepage version
Maria Matejka [Sun, 19 Jan 2025 00:06:24 +0000 (01:06 +0100)] 
Doc: building singlepage version

Some minor changes were done in the original documentation to allow for
easier conversion, and also to make the documentation a little bit more
strictly valid.

This change caters for the new website automation and allows for future
online display of documentation even for development versions.

4 months agoBGP: Fix crash on too long export
Maria Matejka [Wed, 7 May 2025 13:02:24 +0000 (15:02 +0200)] 
BGP: Fix crash on too long export

When BGP route is short enough to be accepted but too long after local
changes, it is converted to withdraw. In these cases though, there was
a dangling pointer left from the prefix structure to the attribute
bucket.

That pointer is now pointing at the right place after the bucket gets
converted to withdraw.

Thanks to ix.br for catching and reporting this issue.

6 months agoNEWS and version update v3.0.2
Maria Matejka [Tue, 1 Apr 2025 19:49:58 +0000 (21:49 +0200)] 
NEWS and version update

6 months agoFix dependecy issue with bs4 on legacy distros
David Petera [Fri, 28 Feb 2025 14:40:04 +0000 (15:40 +0100)] 
Fix dependecy issue with bs4 on legacy distros

6 months agoCI: fix test collisions between branches
Maria Matejka [Tue, 17 Dec 2024 11:38:12 +0000 (12:38 +0100)] 
CI: fix test collisions between branches

The build-netlab job was side-effecting the test-* jobs,
and if for some reason Gitlab scheduled build-netlab before
other pipeline's test-* jobs finished, these jobs got a wrong
binary, possibly failing. Solved by using explicit artifacts, which is
not the fastest way to do this (we could keep the binaries named there)
but it's the gitlab-right way to do this.

6 months agoBFD: Fix crash related to reconfiguration and passwords
Ondrej Zajicek [Thu, 27 Mar 2025 16:43:56 +0000 (17:43 +0100)] 
BFD: Fix crash related to reconfiguration and passwords

Any change in BFD iface configuration should trigger session
reconfiguration, as config is copied into the bfd_session structure
and not just accessed through the bfd_iface structure.

As bfd_session now contains a pointer to the password list allocated
from the configuration, forgetting to update the bfd_session causes
use-after-free.

Thanks to Lexi Winter for the bugreport.

6 months agoBGP: Fix missing case for decoding link-local next hops in VPN SAFI
Ondrej Zajicek [Mon, 24 Mar 2025 16:03:41 +0000 (17:03 +0100)] 
BGP: Fix missing case for decoding link-local next hops in VPN SAFI

6 months agoLog: Fix handling of L_BUG messages
Ondrej Zajicek [Fri, 14 Mar 2025 15:49:36 +0000 (16:49 +0100)] 
Log: Fix handling of L_BUG messages

Due to an off-by-one error, L_BUG messages (e.g. from ASSERT()) were
handled as L_DBG messages and therefore ignored by our CI.

6 months agoTable export: ignoring invalid routes before marking them in export maps
Maria Matejka [Mon, 10 Mar 2025 19:20:32 +0000 (20:20 +0100)] 
Table export: ignoring invalid routes before marking them in export maps

Fast subsequent updates on filtered routes made the code crash because
no flags were set while ignoring them. And if these routes flapped, the
squashed export update crashed on a consistency check.

We ignore them unconditionally so we don't have to mark them at all and
we can convert them to NULL even before export maps are touched.

6 months agoFix crash on graceful restart of a channel with ROA subscription
Maria Matejka [Mon, 10 Mar 2025 18:57:39 +0000 (19:57 +0100)] 
Fix crash on graceful restart of a channel with ROA subscription

Reported by NIX-CZ, thanks!

6 months agoTable export: consider route never seen before actually nonexistent
Maria Matejka [Mon, 10 Mar 2025 14:58:33 +0000 (15:58 +0100)] 
Table export: consider route never seen before actually nonexistent

This may trigger some spurious warnings.

6 months agoTable export: Relaxing too strict inconsistency assert
Maria Matejka [Mon, 10 Mar 2025 08:15:53 +0000 (09:15 +0100)] 
Table export: Relaxing too strict inconsistency assert

In case of refeeds, we may get old routes which we have not seen,
the table does not know that and the channel ingress is the right place
to detect it.

Bug introduced in commit 25557fceb08c8db6daead02a2f4b7a99d8a1f922
by Maria Matejka <mq@ucw.cz>, Mon Mar 3 19:48:58 2025 +0100

    Table export: Another inconsistency in refeeds

6 months agoFixed refeed seqmap inconsistency
Maria Matejka [Sat, 8 Mar 2025 16:09:35 +0000 (17:09 +0100)] 
Fixed refeed seqmap inconsistency

For some weird reason (probably oversight, as always), regular exports
were not marked in seq_map, leading to sus reexports and confusing
refeeds.

7 months agoTable best export: asserting seqmap consistency
Maria Matejka [Tue, 4 Mar 2025 12:04:20 +0000 (13:04 +0100)] 
Table best export: asserting seqmap consistency

In case of some exports have been seen and others not, it makes no sense
for the second one to be seen if the first one was not seen.

7 months agoRCU Unwinder stores where it came from last time
Maria Matejka [Tue, 4 Mar 2025 12:02:01 +0000 (13:02 +0100)] 
RCU Unwinder stores where it came from last time

This information is vital for stuck situations where the
RCU Unwinder keeps longjumping away.

7 months agoTable export: Another inconsistency in refeeds
Maria Matejka [Mon, 3 Mar 2025 18:48:58 +0000 (19:48 +0100)] 
Table export: Another inconsistency in refeeds

When a route has been already sent to the channel and the refeed
runs because of a filter change or just because requested, the
old and new routes are the same which was actually not anticipated
by rt_notify_basic().

7 months agoFilters: don't rewrite gw explicitly set by filters
Maria Matejka [Wed, 26 Feb 2025 13:45:24 +0000 (14:45 +0100)] 
Filters: don't rewrite gw explicitly set by filters

If the originating protocol sets hostentry, it should be
overridden by filters and not rewrite gw.

This fixes #156. Issue #154 may need a similar fix.

Thanks to Peter Hutchinson for reporting.

Signed-Off-By: Katerina Kubecova <katerina.kubecova@nic.cz>
7 months agoFix source-specific routing in Bird 3
Toke Høiland-Jørgensen via Bird-users [Tue, 25 Feb 2025 15:05:10 +0000 (16:05 +0100)] 
Fix source-specific routing in Bird 3

Commit 69d1ffde4c72 ("Split route data structure to storage (ro) /
manipulation (rw) structures.") changed rte->net from a pointer to a
'struct network' to a 'struct net_addr', but kept the address-of (&)
operator before casting to 'net_addr_ip6_sadr *' when sending a
source-specific route to the kernel.

Because 'struct network' had an embedded struct member (struct
fib_node), the address-of was needed to get back to a pointer to the
data, but with the change in the commit mentioned above, e->net is now a
straight pointer to the address.

The bug meant that the source prefixes passed to the kernel were
essentially garbage, leading to routes in the kernel like:

default from b74:9e05:0:1:d8cf:c000::/86 via fe80::1 dev eth0 proto bird metric 32 pref medium

Fix this by getting rid of the address-of operator.

Note by commiter: used our TYPE_CAST macro instead of plain typecast
to avoid this kind of problem in future.

Fixes: 69d1ffde4c72 ("Split route data structure to storage (ro) / manipulation (rw) structures.")
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Maria Matejka <mq@jmq.cz>
7 months agoTable export: fixed inconsistency in export_rejected_map
Katerina Kubecova [Tue, 25 Feb 2025 11:46:06 +0000 (12:46 +0100)] 
Table export: fixed inconsistency in export_rejected_map

When updates arrived in such an order that the first one was rejected and
the second one got accepted, the export_rejected_map flag mistakenly
stayed set, leaking the route ID.

In the RA_OPTIMAL channel mode, there are consistency checks that at
most one route for a net has been accepted or rejected. After some time,
the leaked ID and bit in export_rejected_map caused spurious crashes in
asserts later in channel_notify_basic().

Thanks to NIX-CZ and Maiyun Zhang for reporting this.

7 months agoFixing a refeed inconsistency
Maria Matejka [Mon, 17 Feb 2025 20:37:46 +0000 (21:37 +0100)] 
Fixing a refeed inconsistency

On refeed, the table should not resend any obsolete routes
which have already been seen by the recipient, nor the appropriate
journal items.

7 months agoAdded build for Debian 12
Maria Matejka [Wed, 12 Feb 2025 20:30:55 +0000 (21:30 +0100)] 
Added build for Debian 12

Needed right now for a customer. There is a better fix pending.

7 months agoBGP export table src fix
Maria Matejka [Wed, 12 Feb 2025 20:29:10 +0000 (21:29 +0100)] 
BGP export table src fix

When exchanging routes in BGP export table, we forgot to update
the src in cases of add path off. This led to falsely claiming another
origin of that route in export table dump and also holding protocols
in the flush state because of their srcs being kept in the export tables.

7 months agoFlowspec: allowed TES_PARTIAL in validator link state
Maria Matejka [Tue, 11 Feb 2025 18:57:46 +0000 (19:57 +0100)] 
Flowspec: allowed TES_PARTIAL in validator link state

This probably slipped through some refactoring, TES_PARTIAL
is definitely a valid state for a flowspec link export.

7 months agoFix channel restart sequence
Maria Matejka [Mon, 10 Feb 2025 11:29:51 +0000 (12:29 +0100)] 
Fix channel restart sequence

If channel goes start -> pause -> start, the original code crashed
but it's a valid sequence for protocol half-restart, going from UP
to START and then back UP.

7 months agoOld config should not be freed early when reconfiguring in fast succession
Maria Matejka [Mon, 10 Feb 2025 13:18:19 +0000 (14:18 +0100)] 
Old config should not be freed early when reconfiguring in fast succession

7 months agoKernel: pause exports also on restart until scan is done
Maria Matejka [Wed, 12 Feb 2025 11:38:20 +0000 (12:38 +0100)] 
Kernel: pause exports also on restart until scan is done

To save some time, exports are disabled to kernel when the initial scan
is running. The same should happen when kernel protocol is restarting.

8 months agoBGP: fix shutdown crash when dynamic peer is just connected
Maria Matejka [Mon, 13 Jan 2025 21:15:52 +0000 (22:15 +0100)] 
BGP: fix shutdown crash when dynamic peer is just connected

In some edge cases, the dynamic BGP starts but doesn't yet pick up
the socket from the peer, when it gets shut down, typically on
a complete shutdown. Fixing this to just close the socket, not assert
it being already picked up.

8 months agoNEWS and version update v3.0.1
Maria Matejka [Thu, 9 Jan 2025 20:54:53 +0000 (21:54 +0100)] 
NEWS and version update

8 months agoMerge remote-tracking branch 'origin/stable-v2.16' into HEAD
Maria Matejka [Thu, 9 Jan 2025 20:54:15 +0000 (21:54 +0100)] 
Merge remote-tracking branch 'origin/stable-v2.16' into HEAD

8 months agoNEWS and version update v2.16.1
Maria Matejka [Thu, 9 Jan 2025 20:51:15 +0000 (21:51 +0100)] 
NEWS and version update

8 months agoMerge commit 'abecb5bb408f253cd24345ba94940ea0f7b59f4f' into HEAD
Maria Matejka [Thu, 9 Jan 2025 17:55:26 +0000 (18:55 +0100)] 
Merge commit 'abecb5bb408f253cd24345ba94940ea0f7b59f4f' into HEAD

8 months agoMerge commit '85aa283071ed75059fd8c889bc4ee33be1f901af' into HEAD
Maria Matejka [Thu, 9 Jan 2025 17:46:04 +0000 (18:46 +0100)] 
Merge commit '85aa283071ed75059fd8c889bc4ee33be1f901af' into HEAD

8 months agoMerge commit 'd221f39731be40ed3821f8db09d590edb849cb0c' into HEAD
Maria Matejka [Thu, 9 Jan 2025 17:45:50 +0000 (18:45 +0100)] 
Merge commit 'd221f39731be40ed3821f8db09d590edb849cb0c' into HEAD

8 months agoMerge commit 'e063365590b9b857a5bd0acfa519783eba639bbf' into stable-v3.0
Maria Matejka [Thu, 9 Jan 2025 17:30:33 +0000 (18:30 +0100)] 
Merge commit 'e063365590b9b857a5bd0acfa519783eba639bbf' into stable-v3.0

8 months agolib: Unify alignment of allocators
Ondrej Zajicek [Thu, 9 Jan 2025 15:44:51 +0000 (16:44 +0100)] 
lib: Unify alignment of allocators

Different internal allocators (memory blocks, linpools, and slabs) used
different way to compute alignment. Unify it to use alignment based on
standard max_align_t type.

On x86_64, this does not change alignment of memory blocks and linpools
(both old and new is 16), but it increases alignment of slabs from 8 to
16.

Minor changes by commiter.

8 months agoTable: Fixed table debug settings reconfiguration
Maria Matejka [Wed, 8 Jan 2025 19:59:03 +0000 (20:59 +0100)] 
Table: Fixed table debug settings reconfiguration

8 months agoTable: more best route refeed fixes
Maria Matejka [Wed, 8 Jan 2025 19:22:21 +0000 (20:22 +0100)] 
Table: more best route refeed fixes

Best route refeed is tricky. The journal may include repeatedly the same
route in the old and/or in the new position in case of flaps. We don't
like checking that fully in the RCU critical section which is already
way too long, thus we filter out the repeated occurence of the current
best route while keeping possibly more old routes.

We also don't want to send spurious withdraws, and we need to check that
only one notification per net is sent for RA_OPTIMAL.

There was also missing a rejected map update in case of idempotent
squashed update, and last but not least, the best route journal should
not include invalid routes (import keep filtered).

8 months agoTable: old best route refeed fix
Maria Matejka [Tue, 7 Jan 2025 11:13:57 +0000 (12:13 +0100)] 
Table: old best route refeed fix

When refeeding with RA_OPTIMAL, the old best routes weren't announced,
leading to weird behavior of protocols, mostly kernel. Fixed.

8 months agoBGP: fixed deterministic med crashes
Maria Matejka [Tue, 7 Jan 2025 10:08:04 +0000 (11:08 +0100)] 
BGP: fixed deterministic med crashes

There were several places of forgotten NULL checks.

Thanks to Alarig Le Lay <alarig@swordarmor.fr> for reporting:
https://trubka.network.cz/pipermail/bird-users/2024-December/017990.html

8 months agoBGP: fix display name of bgp_otc attribute
Maria Matejka [Fri, 27 Dec 2024 15:22:59 +0000 (16:22 +0100)] 
BGP: fix display name of bgp_otc attribute

8 months agoAllocate the normalization buckets on stack
Maria Matejka [Tue, 24 Dec 2024 15:16:55 +0000 (16:16 +0100)] 
Allocate the normalization buckets on stack

Even though allocating from tmp_linpool is quite cheap,
it isn't cheap when the block is larger than a page, which is the case here.
Instead, we now allocate just the result which typically fits in a page,
avoiding a necessity of a malloc().

8 months agoBGP: TX bucket storage moved to Stonehenge
Maria Matejka [Tue, 24 Dec 2024 12:22:56 +0000 (13:22 +0100)] 
BGP: TX bucket storage moved to Stonehenge

8 months agoRoute attribute storage moved to Stonehenge
Maria Matejka [Tue, 24 Dec 2024 12:12:58 +0000 (13:12 +0100)] 
Route attribute storage moved to Stonehenge

8 months agoStonehenge: multi-slab allocator
Maria Matejka [Tue, 24 Dec 2024 11:18:39 +0000 (12:18 +0100)] 
Stonehenge: multi-slab allocator

To mid-term allocate and free lots of small blocks in a fast pace,
mb_alloc is too slow and causes heap bloating. We can already allocate
blocks from slabs, and if we allow for a little bit of inefficiency,
we can just use multiple slabs with stepped sizes.

This technique is already used in ea_list allocation which is gonna be
converted to Stonehenge.

8 months agoGraceful recovery: converted to obstacles
Maria Matejka [Mon, 23 Dec 2024 20:06:26 +0000 (21:06 +0100)] 
Graceful recovery: converted to obstacles

Yet another refcounting mechanism had a locking collision.

8 months agoKernel: feed only once during startup
Maria Matejka [Mon, 23 Dec 2024 10:58:05 +0000 (11:58 +0100)] 
Kernel: feed only once during startup

There was an inefficiency in the initial scan state machine,
causing routes to be fed several times instead of just once.
Now the export startup is postponed until first krt_scan()
finishes and we actually can do the pruning with full information.

8 months agoCLI: Flushing tmp_linpool after every shown net.
Maria Matejka [Sun, 22 Dec 2024 21:26:44 +0000 (22:26 +0100)] 
CLI: Flushing tmp_linpool after every shown net.

There is no reason to keep the allocated objects through multiple nets.