]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
3 weeks agoTrie: Tame the static analyzer thread-next
Maria Matejka [Thu, 8 Jan 2026 15:19:35 +0000 (16:19 +0100)] 
Trie: Tame the static analyzer

The CLang static analyzer claims that there might be an undefined behavior
but it is provably impossible. Adding an ASSUME call to mute the warning.

4 weeks agoNEWS and version update v3.2.0
Maria Matejka [Fri, 26 Dec 2025 16:16:05 +0000 (17:16 +0100)] 
NEWS and version update

4 weeks agoMerge remote-tracking branch 'origin/master' into thread-next
Maria Matejka [Fri, 26 Dec 2025 16:15:01 +0000 (17:15 +0100)] 
Merge remote-tracking branch 'origin/master' into thread-next

4 weeks agoNEWS and version update master v2.18
Maria Matejka [Fri, 26 Dec 2025 13:41:15 +0000 (14:41 +0100)] 
NEWS and version update

5 weeks agoCI: Packaging cleanup
Maria Matejka [Thu, 25 Dec 2025 17:19:48 +0000 (18:19 +0100)] 
CI: Packaging cleanup

With the removal of APKG, we don't need to split out "-legacy" DEB with
old python, and "-wa" RPM with an obscure sed applied to specfile which
never actually did anything since added in 2021.

5 weeks agoMerge branch 'origin/master' into thread-next
Maria Matejka [Wed, 24 Dec 2025 22:19:47 +0000 (23:19 +0100)] 
Merge branch 'origin/master' into thread-next

5 weeks agoCI: No more APKG in packaging
Maria Matejka [Sat, 6 Dec 2025 21:43:54 +0000 (22:43 +0100)] 
CI: No more APKG in packaging

We have had minor and subtle but repeating problems with the APKG
dependency chain and its overall usability. It has become apparent
that we actually don't need that kind of abstraction layer because
all our problems are actually solvable by just a bunch of short scripts.

With that, we are now using the (standard) dpkg-buildpackage and
rpmbuild tools directly from bash script.

From now on, with just several exceptions, all our distribution builds
should be fully reproducible.

5 weeks agoSource package and documentation builds are now reproducible
Maria Matejka [Mon, 22 Dec 2025 21:55:22 +0000 (22:55 +0100)] 
Source package and documentation builds are now reproducible

We now explicitly set the PDF build datetime to commit datetime, and we
also clean all the file metadata in the TGZ archives, so that the
generated archives are now bit-identical.

5 weeks agoLib: Fix comments so that progdoc is deterministic
Maria Matejka [Mon, 22 Dec 2025 22:27:27 +0000 (23:27 +0100)] 
Lib: Fix comments so that progdoc is deterministic

For some weird reason, the old Perl code behaves non-deterministically on
@foo() and there is no clear explanation why. The snails should not be there
anyway so removing them.

5 weeks agoCI: Update supported distributions
Maria Matejka [Mon, 1 Dec 2025 18:33:23 +0000 (19:33 +0100)] 
CI: Update supported distributions

+ OpenSUSE 16.0 (by David Petera)
+ Oracle Linux 8, 9 and 10 (fork of RHEL)
+ Fedora 43
+ Ubuntu 25.04 and 25.10.

- Debian 10 is too oldstable.
- Ubuntu 24.10 is EOL.

5 weeks agoDoc: Unfix the stable release version in singlepage doc build
Maria Matejka [Wed, 24 Dec 2025 18:24:11 +0000 (19:24 +0100)] 
Doc: Unfix the stable release version in singlepage doc build

5 weeks agoMerge remote-tracking branch 'origin/master' into thread-next
Maria Matejka [Wed, 24 Dec 2025 18:19:54 +0000 (19:19 +0100)] 
Merge remote-tracking branch 'origin/master' into thread-next

5 weeks agoDoc: Readme update, website is bird.nic.cz
Maria Matejka [Mon, 22 Dec 2025 12:46:53 +0000 (13:46 +0100)] 
Doc: Readme update, website is bird.nic.cz

Updating links to the old website to point to the new website, where
relevant.

Also updated other links in README and some clearly outdated texts.

5 weeks agoDoc: Building singlepage version with the appropriate template
Maria Matejka [Sat, 25 Jan 2025 22:01:11 +0000 (23:01 +0100)] 
Doc: Building singlepage version with the appropriate template

5 weeks agoIGP metric: Split out local_metric again
Maria Matejka [Thu, 18 Dec 2025 11:39:42 +0000 (12:39 +0100)] 
IGP metric: Split out local_metric again

When removing BIRD 2 RTA, I joined rta->igp_metric with
ea_gen_igp_metric, while these two attributes actually have different
semantics. Reintroducing the distinction but with the first one
named local_metric.

This join caused quite some confusion as the igp_metric attribute set in
import filters gets rewritten by recursive nexthop resolution in BIRD 3
up to 3.1.x. Now the igp_metric stays intact and the local_metric is
the original rta->igp_metric which always meant "cost of the local part
of the whole route".

The local_metric attribute also represents the "interior cost" as used
in RFC 4271. When using BGP as an underlay / IGP, one should explicitly
set the igp_metric in the import filter, while the local_metric will be
updated by next hop resolver independently.

Fixes: #154
6 weeks agoMerge remote-tracking branch 'origin/master' into thread-next
Maria Matejka [Wed, 17 Dec 2025 13:31:29 +0000 (14:31 +0100)] 
Merge remote-tracking branch 'origin/master' into thread-next

There is a global check for pthreads and therefore BFD does not need to
check for pthreads anymore itself. Check dropped.

6 weeks agoMinor typos in error messages
Maria Matejka [Wed, 17 Dec 2025 13:21:55 +0000 (14:21 +0100)] 
Minor typos in error messages

Reported-By: Marco d'Itri <md@linux.it>
6 weeks agoConf: Check for enabled pthreads when using BFD
David Petera [Mon, 24 Nov 2025 13:39:38 +0000 (14:39 +0100)] 
Conf: Check for enabled pthreads when using BFD

BFD protocol strictly depends on pthreads being enabled,
but the compilation configuration checks do not reflect it now.

Add a check for pthreads when BFD is included in the
configured protocols.

Thank you Alexander Zubkov <green@qrator.net> for the report and patch!

Closes: #306
8 weeks agoMerge remote-tracking branch 'origin/master' into thread-next
Maria Matejka [Thu, 4 Dec 2025 11:24:29 +0000 (12:24 +0100)] 
Merge remote-tracking branch 'origin/master' into thread-next

2 months agoRAdv: Fix flags for deprecated prefixes
Ondrej Zajicek [Thu, 27 Nov 2025 16:59:44 +0000 (17:59 +0100)] 
RAdv: Fix flags for deprecated prefixes

When a prefix is deprecated (valid_lifetime == 0), it should be
announced with the same flags as before. The old code announced it
without any flags, which leads to being ignored by recipients.

Note that a prefix could be depreacted for two reason - it is removed
from the interface, or it is deconfigured in BIRD configuration.

Thanks to Michael Saxl for the bugreport.

2 months agoBSD: Fix export of non-multipath routes
David Petera [Mon, 24 Nov 2025 14:28:09 +0000 (15:28 +0100)] 
BSD: Fix export of non-multipath routes

Due to incorrect logic in sysdep/bsd/krt-sock.c:krt_capable
it was impossible to export non-mulitpatch route to kernel table.

This is now fixed.

Thanks to Yuri Honegger <yuri.honegger@icloud.com> for report and fix suggestion.

2 months agoBFD: remove unused spinlock
Zhang Maiyun via Bird-users [Sun, 23 Nov 2025 19:38:03 +0000 (14:38 -0500)] 
BFD: remove unused spinlock

The only use of the spinlock in `struct bfd_proto` was removed in 38acb415f
and now it should be fine to remove it.

The check for `pthread_spin*` in `aclocal.m4` is also removed
accordingly. This makes it possible to port BFD support to platforms
without spinlocks (e.g. Darwin)

Signed-off-by: Zhang Maiyun <me@maiyun.me>
2 months agoMRT: Fix crash when protocol mrtdump configured without a specified file
Maria Matejka [Tue, 25 Nov 2025 17:22:26 +0000 (18:22 +0100)] 
MRT: Fix crash when protocol mrtdump configured without a specified file

If somebody configured mrtdump option in the protocol block and had no
mrtdump file configured on toplevel, BIRD 3 would crash on first MRT
message to be written after that.

Fixed by passing the rfile structure through up to the actual place
where mrt_dump_message() checks whether anything is open. Theoretically
there could be a smaller fix involving just adding null-checks to
mrt_dump_bgp_message() and mrt_dump_bgp_state_change(), but this is more
future-proof.

Reported-By: Káťa Kubecová
Fixes: #243
2 months agoFilter: fix undefined memory access in nexthop handling
Maria Matejka [Thu, 20 Nov 2025 11:03:02 +0000 (12:03 +0100)] 
Filter: fix undefined memory access in nexthop handling

If nexthop is special (blackhole, unreachable, prohibit), directly
asking for anything else from there accessed undefined memory. This
manifested with checking for interface name where it actually
dereferenced a pointer from there, causing a crash.

In some cases, reading ifindex might have also sometimes caused a crash.
The other data (weight, gw, gw_mpls, onlink) is stored directly inside
the nexthop EA, and even though it's shorter, in most cases it "just"
returned garbage. The only exception would be probably if the
unreachable nexthop EA was allocated right at the end of tmp_pool or
locally on stack.

Fixing this by properly checking for reachability before reading the
nexthop data.

Reported-By: Lars Gierth <larsg@systemli.org>
Reproduced-By: David Petera <david.petera@nic.cz>
Fixes: #313
2 months agoFilters: Regression test for link-local gateway without interface.
Maria Matejka [Tue, 25 Nov 2025 09:48:29 +0000 (10:48 +0100)] 
Filters: Regression test for link-local gateway without interface.

Related to #257, commit 36a4b74c1195b1a7e1630e0afd7b2e3c60d7aab1.

2 months agoTools: Release initialization script
Maria Matejka [Sat, 22 Nov 2025 22:23:28 +0000 (23:23 +0100)] 
Tools: Release initialization script

There is a bunch of things one needs to do in gitlab when releasing and
this script simply checks whether there is everything needed and fixes
what is missing,

This commit includes the milestone fix.

2 months agoTools: Release initialization script
Maria Matejka [Sat, 22 Nov 2025 22:23:28 +0000 (23:23 +0100)] 
Tools: Release initialization script

There is a bunch of things one needs to do in gitlab when releasing and
this script simply checks whether there is everything needed and fixes
what is missing,

2 months agoMRT: Fix dumps with layered attibutes
Maria Matejka [Fri, 21 Nov 2025 13:08:46 +0000 (14:08 +0100)] 
MRT: Fix dumps with layered attibutes

When route is modified during the import and the import table is on,
it's stored with layered attributes, the bottom layer containing the
original data and over that there are one or more layers containing the
changes.

Dumping into MRT files calls bgp_encode_attr() on that attribute list,
and that function requires attributes to be normalized, i.e. squashed to
one layer which can be then walked. This was mistakenly done only on
uncached attribute lists, while in reality it should be done always
because of the layering.

This caused MRT to crash in case when the import table is on and the
import filter unsets certain BGP attributes, specifically any attribute
which is longer than int, e.g. bgp_path, bgp_cluster_list,
bgp_community or bgp_next_hop. That creates a pseudo-attribute in the
top layer with the undef flag set, and bgp_encode_attr() then crashes on
unexpected NULL pointer dereference.

Fixed by requiring the attributes to be normalized always.

Reported-By: Katerina Kubecova <katerina.kubecova@nic.cz>
2 months agoMerge remote-tracking branch 'origin/master' into thread-next
Maria Matejka [Thu, 20 Nov 2025 13:38:12 +0000 (14:38 +0100)] 
Merge remote-tracking branch 'origin/master' into thread-next

2 months agoBMP: Fix crash when exporting a route with non-bgp attributes
Maria Matejka [Thu, 20 Nov 2025 13:35:02 +0000 (14:35 +0100)] 
BMP: Fix crash when exporting a route with non-bgp attributes

Reported-By: Annika Hannig
2 months agoCI: fix broken debian-11-i386 packaging dp-pipeline-fix-v3
David Petera [Fri, 14 Nov 2025 13:07:38 +0000 (14:07 +0100)] 
CI: fix broken debian-11-i386 packaging

The error occured when trying to install 'markupsafe' v3.0.3 python package (dependency of 'apkg') on debian-11-i386 arch.
Fixed by preinstalling older version of 'markupsafe' package before the installation of 'apkg'.

Since the behavior is added to 'pkg-deb-legacy' it also effects packaging of ubuntu-18.04-amd64.
Also debian-11-amd64 is moved to 'pkg-deb-legacy' together with effected debian-11-i386 just for code clarity.

2 months agoChannel: Fix race condition of a new feed with an update in the table dp-fix-thead-group-conf
Maria Matejka [Fri, 14 Nov 2025 19:11:59 +0000 (20:11 +0100)] 
Channel: Fix race condition of a new feed with an update in the table

In case an update arrived while another thread feeding anew, there was
a race condition causing the old route to be counted against the export limit
despite never reached.

In long run, this caused limit counter underflow and a hard assertion failure.

2 months agoCI: fix broken debian-11-i386 packaging dp-pipeline-fix
David Petera [Fri, 14 Nov 2025 13:07:38 +0000 (14:07 +0100)] 
CI: fix broken debian-11-i386 packaging

The error occured when trying to install 'markupsafe' v3.0.3 python package (dependency of 'apkg') on debian-11-i386 arch.
Fixed by preinstalling older version of 'markupsafe' package before the installation of 'apkg'.

Since the behavior is added to 'pkg-deb-legacy' it also effects packaging of ubuntu-18.04-amd64.
Also debian-11-amd64 is moved to 'pkg-deb-legacy' together with effected debian-11-i386 just for code clarity.

2 months agoConf: Implicit symbols should not generate warnings when overriding keywords
Maria Matejka [Thu, 13 Nov 2025 20:40:21 +0000 (21:40 +0100)] 
Conf: Implicit symbols should not generate warnings when overriding keywords

2 months agoMerge branch 'mq-bgp-multilisten' into 299-mq-bgp-async-listen
Maria Matejka [Thu, 13 Nov 2025 17:13:21 +0000 (18:13 +0100)] 
Merge branch 'mq-bgp-multilisten' into 299-mq-bgp-async-listen

2 months agoMerge commit 'd4f70a6d1' into 299-mq-bgp-async-listen
Maria Matejka [Thu, 13 Nov 2025 17:04:34 +0000 (18:04 +0100)] 
Merge commit 'd4f70a6d1' into 299-mq-bgp-async-listen

2 months agoMerge commit '48bad6834' into 299-mq-bgp-async-listen
Maria Matejka [Thu, 13 Nov 2025 16:56:28 +0000 (17:56 +0100)] 
Merge commit '48bad6834' into 299-mq-bgp-async-listen

2 months agoMerge commit '39258b502' into 299-mq-bgp-async-listen
Maria Matejka [Thu, 13 Nov 2025 15:50:00 +0000 (16:50 +0100)] 
Merge commit '39258b502' into 299-mq-bgp-async-listen

2 months agoIO loop balancer: fix invalid locking combination
Maria Matejka [Thu, 13 Nov 2025 14:18:47 +0000 (15:18 +0100)] 
IO loop balancer: fix invalid locking combination

Oversight introduced in c368ad59d8d39ba5bfe350fdb3641275ee3e3ec5.

2 months agoMerge commit 'bbbdb7829' into 299-mq-bgp-async-listen
Maria Matejka [Thu, 13 Nov 2025 14:17:41 +0000 (15:17 +0100)] 
Merge commit 'bbbdb7829' into 299-mq-bgp-async-listen

2 months agoBGP: reorder code to match v2
Maria Matejka [Thu, 13 Nov 2025 11:31:14 +0000 (12:31 +0100)] 
BGP: reorder code to match v2

2 months agoMerge commit 'b2737b976' into 299-mq-bgp-async-listen
Maria Matejka [Thu, 13 Nov 2025 11:27:24 +0000 (12:27 +0100)] 
Merge commit 'b2737b976' into 299-mq-bgp-async-listen

2 months agoBGP: Decoupling of listen sockets 299-mq-bgp-async-listen
Maria Matejka [Sat, 11 Oct 2025 18:16:57 +0000 (20:16 +0200)] 
BGP: Decoupling of listen sockets

For performance reasons, every listening socket now gets its own loop so
that with strict bind one can accept connections by more threads than
just one.

2 months agoBGP: Listening sockets are, again, opened synchronously
Maria Matejka [Sat, 11 Oct 2025 16:41:56 +0000 (18:41 +0200)] 
BGP: Listening sockets are, again, opened synchronously

This whole operation was needed because of TCP-AO race conditions
and also enhanced dynamic BGP configuration expected for BIRD 2.18 and 3.2.

2 months agoBGP: Store listen socket params also inside the socket structure
Maria Matejka [Sat, 11 Oct 2025 15:54:00 +0000 (17:54 +0200)] 
BGP: Store listen socket params also inside the socket structure

This makes matching sockets to requests easier.

2 months agoLocking: Add another locking level between service and protocol
Katerina Kubecova [Tue, 16 Sep 2025 09:38:47 +0000 (11:38 +0200)] 
Locking: Add another locking level between service and protocol

The BGP protocol needs a domain accessed from the protocols but
launching common services. This could have been done, theoretically,
by abusing the rtable and attrs levels, but that would require
having a loop on that level which we'd like to not do.

2 months agoBGP: Sending the incoming socket to the receiving protocol by callback
Katerina Kubecova [Fri, 5 Sep 2025 12:14:05 +0000 (14:14 +0200)] 
BGP: Sending the incoming socket to the receiving protocol by callback

Instead of processing the incoming sockets directly in the main loop,
this can be done in the protocol's loop without having to enter and exit
that loop in a complicated way.

2 months agoBGP: Converting the listen socket data to a loop-guarded object
Maria Matejka [Sat, 11 Oct 2025 08:24:56 +0000 (10:24 +0200)] 
BGP: Converting the listen socket data to a loop-guarded object

This makes the locking / unlocking operations easier.

2 months agoObjects guarded by their loops
Maria Matejka [Sat, 11 Oct 2025 13:14:10 +0000 (15:14 +0200)] 
Objects guarded by their loops

2 months agoTable: drop LOBJ_(UN)LOCK_SIMPLE
Maria Matejka [Sat, 11 Oct 2025 13:02:31 +0000 (15:02 +0200)] 
Table: drop LOBJ_(UN)LOCK_SIMPLE

This is needed for the next commit.

2 months agoBGP: Storing the protocol accept-matching data in the request
Katerina Kubecova [Thu, 4 Sep 2025 13:31:38 +0000 (15:31 +0200)] 
BGP: Storing the protocol accept-matching data in the request

The common TCP accept routine should not touch the protocol structure
from outside, and it should get all the relevant information directly in
the listen request.

2 months agoMacro for entering birdloops with autoleave
Maria Matejka [Tue, 7 Oct 2025 15:07:49 +0000 (17:07 +0200)] 
Macro for entering birdloops with autoleave

2 months agoBGP: strict bind clarification comment
Maria Matejka [Tue, 7 Oct 2025 10:30:13 +0000 (12:30 +0200)] 
BGP: strict bind clarification comment

2 months agoBGP: Forward-port better solution of listening socket requests
Katerina Kubecova [Thu, 4 Sep 2025 10:34:59 +0000 (12:34 +0200)] 
BGP: Forward-port better solution of listening socket requests

In master (upcoming v2.18), the listening socket creation has been
resolved better than in current v3, and thus we forward-port that
solution from the mq-bgp-multilisten branch before actually merging
master.

2 months agoMerge commit 'dff90f5' into mq-tmp-babel mq-thread-next-next
Maria Matejka [Thu, 13 Nov 2025 11:17:59 +0000 (12:17 +0100)] 
Merge commit 'dff90f5' into mq-tmp-babel

2 months agoMerge commit '33791f1f4' into mq-tmp-babel
Maria Matejka [Thu, 13 Nov 2025 11:16:15 +0000 (12:16 +0100)] 
Merge commit '33791f1f4' into mq-tmp-babel

2 months agoBGP: Fix interface pattern behavior with free bind mq-bgp-multilisten
Maria Matejka [Thu, 28 Aug 2025 18:18:46 +0000 (20:18 +0200)] 
BGP: Fix interface pattern behavior with free bind

In case of free bind, it makes no sense to check for addresses
on the interfaces.

Also added quite some documentation on how this all behaves
in different combinations of options.

2 months agoBGP: Refactoring incoming socket matching
Maria Matejka [Wed, 20 Aug 2025 09:52:26 +0000 (11:52 +0200)] 
BGP: Refactoring incoming socket matching

2 months agoBGP: Rewind MD5 setup on listening sockets on setup failure
Maria Matejka [Tue, 19 Aug 2025 09:16:15 +0000 (11:16 +0200)] 
BGP: Rewind MD5 setup on listening sockets on setup failure

2 months agoBGP: Interface range bind
Maria Matejka [Thu, 3 Jul 2025 15:16:14 +0000 (17:16 +0200)] 
BGP: Interface range bind

For dynamic onlink connections, we need to find out which interface
the connection came in, and we need to pin that connection to
that interface. To achieve that, we create a listening socket
bound to each interface separately, and match the incoming connection
by the socket. Otherwise, the kernel would not give us any information
on where the connection came from.

2 months agoBGP: Listening socket refactoring
Maria Matejka [Thu, 3 Jul 2025 09:58:01 +0000 (11:58 +0200)] 
BGP: Listening socket refactoring

We sometimes need to have multiple listening sockets for one passive
BGP. This refactoring commit updates the appropriate data structures.

2 months agoSocket: Warnings for link-local addresses without interfaces
Maria Matejka [Wed, 2 Jul 2025 14:40:34 +0000 (16:40 +0200)] 
Socket: Warnings for link-local addresses without interfaces

In certain corner cases (e.g. mixed global and link-local IPv6 address)
the kernel fails to give us the interface ID. We log a warning for such
a case before a possibly misleading error message is spit out by BGP.

Also pass TCP interface information from parent to child on accept,
if the interface is bound to that interface.

2 months agoBGP: Fix dynamic instance reconfiguration
Maria Matejka [Wed, 20 Aug 2025 13:35:32 +0000 (15:35 +0200)] 
BGP: Fix dynamic instance reconfiguration

Every dynamic BGP was torn down on reconfig because the inherited
configuration is a little bit different than the parent one. Fixed this
by applying the same changes before the reconfiguration's memcmp().

This bug was introduced in 56af56a5ab8929bf211bdbe8fef28cb37c2cb7fa.

Also fixed interface pattern reconfiguration which always restarted.
Added not only comparison but also actual reconfiguration of the pattern
itself so that one can update the pattern without restarting a running
BGP session.

Finally, extended documentation a bit to cover dynamic BGP scenarios a
little bit better. Yet, it probably deserves a separate section on
dynamic BGP.

2 months agoBGP: Fixed link-local connections with wildcard local iface
Maria Matejka [Wed, 16 Jul 2025 08:45:10 +0000 (10:45 +0200)] 
BGP: Fixed link-local connections with wildcard local iface

When BGP was configured to accept link-local connections
in combination with interface range, it failed to recognize
that the incoming connection is indeed for that protocol.

2 months agoBGP: Show onlink information in CLI
Maria Matejka [Thu, 3 Jul 2025 15:16:45 +0000 (17:16 +0200)] 
BGP: Show onlink information in CLI

2 months agoBGP: Fix TCP-AO single key rejection
Maria Matejka [Wed, 20 Aug 2025 13:34:31 +0000 (15:34 +0200)] 
BGP: Fix TCP-AO single key rejection

When one key fails but others are working OK, do not shut down the BGP,
just disable that one key. We intended to do it this way but it somehow
slipped through.

Also added key cleanup in cases where the key addition fails for just
some sockets but not for all.

2 months agoBGP: Fixed unnumbered connections with wildcard local IP.
Maria Matejka [Tue, 8 Jul 2025 18:28:03 +0000 (20:28 +0200)] 
BGP: Fixed unnumbered connections with wildcard local IP.

When the BGP was configured onlink with a neighbor range, interface
range and wildcard local IP, the connections failed to establish
because the inferred local IP wasn't properly propagated.

2 months agoMove the interfaces locking domain from attrs to rtable
Igor Putovny [Thu, 9 Oct 2025 14:08:47 +0000 (16:08 +0200)] 
Move the interfaces locking domain from attrs to rtable

The interface table domain level has been "attrs" due to limitations
imposed in the early stages of development when all operations on
routing tables, most notably next hop resolution, were done with the
table locked.

Another possible problem was accessing the BGP listen socket structures
which are on the "rtable" level.

Yet, with the introduction of the "service" level and stabilization of
other structures, the interface table domain level does not need to be
at "attrs" anymore, and therefore we may simply move it to "rtable"
as it is actually the right place for that.

This collision also caused problems with external resource locks which
are at the "attrs" level, causing a crash in interface reconfiguration
of RIP, Babel and OSPF, when the routines tried to acquire a resource
lock with the interface table being locked. Due to a lack of autotests
for interface reconfiguration, we missed this problem in BIRD 3.

This fixes #305.

2 months 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>
2 months 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

2 months 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
2 months 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
2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months agoNest: Function aspa_check() should return ASPA_INVALID for paths containing AS_SET
Evann DREUMONT [Tue, 2 Sep 2025 14:23:34 +0000 (16:23 +0200)] 
Nest: Function aspa_check() should return ASPA_INVALID for paths containing AS_SET

The aspa_check() uses as_path_getlen() to estimate the size of a buffer,
which does not work for AS_SET segments, because as_path_getlen() returns
length 1 for them regardless of their length. This may cause buffer
overflow and crash.

As AS_SET segments are not valid for ASPA verification, we can just
handle them explicitly. See https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-aspa-verification#section-6

Co-Authored-By: Alarig <alarig@swordarmor.fr>
Minor changes by committer.

2 months 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
2 months agoRAdv: Add P-flag to prefer prefix delegation in DHCPv6 ip-radv-pflag
Igor Putovny [Tue, 4 Nov 2025 14:15:54 +0000 (15:15 +0100)] 
RAdv: Add P-flag to prefer prefix delegation in DHCPv6

3 months agoConf: Add warning for symbol overriding keyword oz-test
Ondrej Zajicek [Thu, 16 Oct 2025 15:03:38 +0000 (17:03 +0200)] 
Conf: Add warning for symbol overriding keyword

In BIRD configuration, used-defined symbols can override keywords, which
could lead to an unexpected behavior when one tries to use such keyword
in its original meaning.

3 months agoFilter: Allow merging of intervals in build_tree()
Igor Putovny [Tue, 23 Sep 2025 14:58:14 +0000 (16:58 +0200)] 
Filter: Allow merging of intervals in build_tree()

Fixes a bug that overlapping intervals in sets are not processed properly.

4 months agoNest: Fix legacy formatting of community attributes
Alexander Zubkov [Tue, 23 Sep 2025 14:27:08 +0000 (16:27 +0200)] 
Nest: Fix legacy formatting of community attributes

Fix an issue that when a socket is configured with 'v2 attributes'
some attributes weren not shown in v2 format.

4 months agoL3VPN: Add support for import/export target none and import target all
Ondrej Zajicek [Fri, 19 Sep 2025 16:46:41 +0000 (18:46 +0200)] 
L3VPN: Add support for import/export target none and import target all

The patch adds support for 'import/export target none' (or '[]' to
specify an empty set). It can be used when we do not want to import/export
any route from/to the VRF, or if we prefer to set the RT it in filters
(e.g., adding a different RT for different IP prefixes).

The patch also adds support for 'import target all', i.e. all VPN routes
are imported in the VRF IP table regardless of the RTs. Useful when more
complexx policy implemented in filters.

Based on patches from Sébastien Parisot <sparisot@iliad-free.fr>, thanks!

4 months agoNest: Function aspa_check() should return ASPA_INVALID for paths containing AS_SET
Evann DREUMONT [Tue, 2 Sep 2025 14:23:34 +0000 (16:23 +0200)] 
Nest: Function aspa_check() should return ASPA_INVALID for paths containing AS_SET

The aspa_check() uses as_path_getlen() to estimate the size of a buffer,
which does not work for AS_SET segments, because as_path_getlen() returns
length 1 for them regardless of their length. This may cause buffer
overflow and crash.

As AS_SET segments are not valid for ASPA verification, we can just
handle them explicitly. See https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-aspa-verification#section-6

Co-Authored-By: Alarig <alarig@swordarmor.fr>
Minor changes by committer.

5 months agoMerge commit 'ab827cb15' into thread-next
Maria Matejka [Thu, 28 Aug 2025 18:38:37 +0000 (20:38 +0200)] 
Merge commit 'ab827cb15' into thread-next

5 months agoTable: Optimal and Any Export refactoring
Maria Matejka [Tue, 26 Aug 2025 14:14:38 +0000 (16:14 +0200)] 
Table: Optimal and Any Export refactoring

The original channel_notify_basic() function was so complicated that it
made more sense to split this one into two different functions, one for
RA_ANY, another for RA_OPTIMAL.

I also changed the export_filter() to not touch the rejected_map, and
just return true/false while modifying the route in place which was
already happening anyway.

In addition to this, I added more comments and I hope that now the code
is better approachable and understandable.

Last but not least, I changed several export flag consistency checks
to just error messages if these were harmless enough.

related to #281

5 months agoConf: Fix thread groups. Allow for multiple options in the block.
David Petera [Wed, 27 Aug 2025 07:59:17 +0000 (09:59 +0200)] 
Conf: Fix thread groups. Allow for multiple options in the block.

Reported-By: Robert Lister <rob@lonap.net>
5 months agoCI: Add test of user and groups before and after package installation dp-ci-debian-trixie
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

5 months 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

5 months 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

6 months agoBGP: Do not restart when next hop keep/self is changed
Maria Matejka [Tue, 29 Jul 2025 12:15:08 +0000 (14:15 +0200)] 
BGP: Do not restart when next hop keep/self is changed

The change in dade7147eb6b62b2d58d478a370baef513d96975 forces BGP to restart
even if next hop self and next hop keep changes, which can be updated just by
reloading export, while explicit next hop address can not.

Related to #280.

6 months agoMerge branch '280-mq-nexthop' into HEAD
Maria Matejka [Fri, 18 Jul 2025 11:18:36 +0000 (13:18 +0200)] 
Merge branch '280-mq-nexthop' into HEAD

6 months agoBGP: Reintroduce channel reload message on forced route refresh
Maria Matejka [Thu, 17 Jul 2025 17:11:25 +0000 (19:11 +0200)] 
BGP: Reintroduce channel reload message on forced route refresh

When reconfiguration needs a forced route refresh because of
changed protocol/channel parameters, log the same message
as v2 does.

6 months agoMerge remote-tracking branch 'origin/master' into thread-next
Maria Matejka [Fri, 18 Jul 2025 11:17:54 +0000 (13:17 +0200)] 
Merge remote-tracking branch 'origin/master' into thread-next

6 months agoCI: Autotests for BGP setting changes
Maria Matejka [Thu, 17 Jul 2025 22:19:14 +0000 (00:19 +0200)] 
CI: Autotests for BGP setting changes

There are actually 144 test variants. Choosing 12 of them, such that:

- m2 may request no RR, basic RR or enhanced RR
- m2 may have any combination of import and export table
- import and export table settings for m1 are pseudorandomized
- the same for multiple variants how to get basic RR negotiated

This should cover all the code with not too much resource consumption.

Implements #239.

6 months agoBGP: restart on outgoing next hop setting change
Maria Matejka [Wed, 25 Jun 2025 11:00:11 +0000 (13:00 +0200)] 
BGP: restart on outgoing next hop setting change

When next hop self / keep / address changed, BGP only reloaded
the exports but it didn't apply the changes. To fix this problem
before actually implementing a proper change detection algorithm,
we restart the protocol if this setting changes.

Fixes #280.

7 months agoFilter: Add more tests for append operator
Ondrej Zajicek [Tue, 1 Jul 2025 14:43:18 +0000 (16:43 +0200)] 
Filter: Add more tests for append operator

7 months agoFilter: Add 'append' operator
Ondrej Zajicek [Tue, 3 Jun 2025 02:04:47 +0000 (04:04 +0200)] 
Filter: Add 'append' operator

We need append() operator to concatenate strings / bytestrings.
Can be also written as '++', (e.g. "abcd" ++ "1234").

7 months agoMerge remote-tracking branch 'origin/master' into HEAD
Maria Matejka [Mon, 30 Jun 2025 07:11:06 +0000 (09:11 +0200)] 
Merge remote-tracking branch 'origin/master' into HEAD

7 months agoCI: adding tests cf-bgp-unnumbered and cf-bgp-error-states
Maria Matejka [Sun, 29 Jun 2025 18:14:31 +0000 (20:14 +0200)] 
CI: adding tests cf-bgp-unnumbered and cf-bgp-error-states

The unnumbered test checks the onlink neighbor scenarios,
and the cf-bgp-error-states checks a regression for BIRD 3
where BGP crashed when listening socket failed to bind.