Maria Matejka [Thu, 19 Mar 2026 11:01:15 +0000 (12:01 +0100)]
Log: Set a reasonable lower bound for the log file size limit
The log rotation needs a minimal file size. The 16 kB limit imposed
by this commit effectively allows about 150 lines to fit into one file,
and by that all the accompanying log messages (e.g. with debug latency)
fit into there and don't cause another rotation.
Maria Matejka [Mon, 23 Mar 2026 22:08:12 +0000 (23:08 +0100)]
CI: Templated gitlab dockerfiles
This allows to add new distributions and mass-modify build environments
at a single place if any such need occurs. Also there is less risk that
some file is omitted if modifying multiple places in the same way.
There is also a check re-generating the templates in the CI and failing
immediately if they are not up-to-date.
Maria Matejka [Sun, 22 Mar 2026 01:54:36 +0000 (02:54 +0100)]
CI: Refactoring of pipeline job rules
Implemented:
- manual and scheduled pipeline run support
- inputs to explicitly choose which job categories to run
- docker rebuild only manually
- no packaging for development branches
Maria Matejka [Sun, 15 Mar 2026 17:39:28 +0000 (18:39 +0100)]
ASPA: Document our aspa_check() implementation.
There are certain design choices behind the implementation,
and as the ASPA algorithm is quite complex even in the specification,
we should add some explanation here.
Our approach is not directly following the specification, as checking
the authorized() function specified in the draft is performance-heavy.
Also, there are some more future plans with this, and they deserve
documenting as well.
Maria Matejka [Sat, 14 Mar 2026 20:57:46 +0000 (21:57 +0100)]
ASPA: Fix downstream check for two-point apex
The ASPA algorithm is quite complex if one wants to execute it fast.
Most notably, the performance-critical part is looking up the ASPA
records, and we are trying to reduce that to minimum.
Yet, in that effort, we missed the fact that in the downstream
algorithm, the down-ramp and up-ramp may touch, i.e. their top ends
have a lateral peering.
The original idea was to find the point where the down-ramp is
impossible to be extended, and from there on, the algorithm is basically
just the upstream algorithm. But it isn't, most notably with the lateral
peering scenario it is much more complex than this.
This issue was discovered by several people, and got a fix submitted by
Evann DREUMONT. That fix was correct but replaced the algorithm too
deeply. We don't want to do such large changes (including semantics)
inside the stable versions, and we have some more plans with all of this
considering performance, as soon as more ASPA records emerge.
This patch therefore simply removes the force_upstream shortcut from
where the down ramp is terminated, fixes the downstream code so that
it works without that shortcut, and explicitly allows the two-apex
downstream scenario.
Ondrej Zajicek [Tue, 24 Feb 2026 22:15:06 +0000 (23:15 +0100)]
BGP: Automatic peering based on discovered neighbors
Extend existing dynamic BGP code to support spawning of active BGP
instances for discovered neighbors.
The existence of such dynamic BGP instances is controlled by exporting
information from a table containing neighbor entries through a newly
introduced neighbor channel. This means that the feature will only work
if there is another protocol responsible for discovering and announcing
neighbor entries (e.g. RAdv with 'router discovery' enabled).
Based on the patch from Matteo Perin <matteo.perin@canonical.com>, thanks!
Matteo Perin [Tue, 24 Feb 2026 22:15:06 +0000 (23:15 +0100)]
RAdv: Router discovery based on incoming Router Advertisments
Up until this point no much use has been make of incoming RAs, this commit
tries to amend that by announcing peer-based routes to a new peer channel.
This will allow to use the information discovered about remote routers
by other protocols.
RA staleness has also been taken into consideration and the routes are
withdrawn whenever the advertised router lifetime expires.
The feature is meant to be enabled via a new configuration option in
the RAdv protocol called router discovery [yes/no].
Matteo Perin [Tue, 24 Feb 2026 22:15:06 +0000 (23:15 +0100)]
Nest: Add net_addr_nbr route type to track discovered neighbors
The definition and helper functions for a new route-like object to track
peer discovery data has been added. It only contains the (v4 or v6)
neighbor address and the ingress iface index, for now.
The main intent of this is, currently, to enable BGP unnumbered auto
peer discovery via RAdv incoming advertisments, but in the future the
same data structure could be used to allow discovery coming from
different protocols.
Ondrej Zajicek [Thu, 26 Feb 2026 14:29:40 +0000 (15:29 +0100)]
Nest: Improve reconfiguration of dynamic BGP
During reconfiguration, first add all existing dynamic protocols to the
new BGP config to ensure that there is already full set of protocols
when reconfiguration hooks for individual protocols are called.
Also, bgp_spawn() should not be called when parent BGP is not yet
configured, otherwise we would end with an old proto_config linked
from the new configuration.
Joshua Rogers [Tue, 10 Feb 2026 00:10:28 +0000 (01:10 +0100)]
Netlink: Fix handling of RTAX_CC_ALGO netlink attribute
The kernel-provided congestion control algorithm (RTAX_CC_ALGO) is stored in
an EAF_TYPE_STRING adata blob without the terminating NULL. When exporting
metrics back to netlink, the value is treated as a C string and passed to
nl_add_attr_str(), which uses strlen(str)+1. This may read past the allocated
adata and leak adjacent memory or crash.
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.
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.
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.
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.
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.
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,
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.
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().
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.
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.
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.
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.
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.
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.
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.
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!
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.
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.
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.
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.
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.
Maria Matejka [Thu, 19 Jun 2025 16:57:15 +0000 (18:57 +0200)]
BGP: Allow onlink neighbors
In certain scenarios, the direct neighbor is not inside any prefix
assigned to the appropriate interface. There is a route for that address
pointing to that interface, though.
In such cases, the user may specify the neighbor as onlink, effectively
disabling the prefix check and trying to connect immediately. It is
expected that the operator ensures that the neighbor is indeed there.
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.
Maria Matejka [Thu, 19 Jun 2025 16:40:23 +0000 (18:40 +0200)]
CI: split make gitlab to local and venv variant
If you prefer to install python3-jinja2 and pyaml yourself,
run gitlab-local. If you prefer the thing to create a venv
and pip3 all the dependencies, run gitlab-venv.
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.
Igor Putovny [Mon, 2 Jun 2025 11:44:42 +0000 (13:44 +0200)]
BGP: Disallow AS Sets by default
For a long time, AS Sets have been considered obsolete
but they were still valid by the original RFC. Recently,
RFC 9774 flipped this and AS Sets are now formally deprecated.
Therefore, all BGP sessions will now by default reject routes
containing AS Sets in their AS Paths. If you want to keep the
old behavior, you may simply state
allow as set;
in every BGP protocol configuration where you want to accept AS Sets.
Maria Matejka [Wed, 4 Jun 2025 12:53:36 +0000 (14:53 +0200)]
BGP: Restart if route refresh is impossible on attribute change
In previous commit, we force route refresh when some protocol attributes
change. Yet, when the neighbor doesn't support route refresh, we have to
restart the session, not send an unsupported request.
Note: if the neighbor is restarting right now with graceful restart
enabled, we keep the stale routes until the neighbor converges again.
Ondrej Zajicek [Tue, 3 Jun 2025 14:56:41 +0000 (16:56 +0200)]
BGP: Do route refresh after preference change
Reconfiguration of preference is handled by nest code by asking for
reload, but in case of BGP with import table, that just reloaded routes
with the old preference. In BGP, we can handle that by triggering full
route refresh.
Although, it would be probably better to set preference in nest, when
a route is propagated from the import table.
Ondrej Zajicek [Thu, 29 May 2025 15:34:35 +0000 (17:34 +0200)]
Nest: Fix route update after preference change
The route preference was ignored in route comparison, therefore if
a protocol changed it and then reloaded routes, they were ignored
and routes with the old prefernce were kept.
The bug was introduced 5 years ago, when preference was moved from
struct rte to struct rta.