0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-02-13 11:36:42 +00:00

4317 Commits

Author SHA1 Message Date
Ondrej Zajicek
a8fa3f6b8d 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.
2025-02-04 16:10:07 +01:00
Ondrej Zajicek
deec84ca33 Update obsolete RFC 5575 to newer RFCs 8955 / 8956 2025-02-04 16:07:09 +01:00
David Petera
6919a54ef3 Update the obsoleted RFC 5575 by newer RFCs 8955 (ipv4) and 8956 (ipv6) 2025-01-30 15:56:31 +01:00
David Petera
738c18c02b Fix the flow6 label description and example 2025-01-30 15:56:31 +01:00
David Petera
a47b6c7195 Fix error in example of direct protocol 2025-01-30 14:38:12 +01:00
David Petera
e0fb3e1255 Fix typo in docs 2025-01-16 11:15:26 +01:00
Jakub Ružička
c848fd1c69 Debian: Depend on libssh's default flavor
This mirrors Debian bird2 change, gcrypt flavor is deprecated.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074257
2025-01-09 01:42:11 +01:00
Jakub Ružička
c7c49c9e2a Debian: Update Standards-Version to latest 4.7.0 2025-01-09 01:42:11 +01:00
Jakub Ružička
5a1b88158d Debian: Reformat with wrap-and-sort -bast 2025-01-09 01:42:11 +01:00
Jakub Ružička
99c423dda1 Debian: Add BuildDepends: ca-certificates
This should reportedly fix test issues on ARM.
2025-01-09 01:42:11 +01:00
Jakub Ružička
87db62fea7 Debian: Add Rules-Requires-Root: no to d/control 2025-01-09 01:42:11 +01:00
Maria Matejka
a07f0b1e7d Static: fixed ASPA reconfiguration
Due to an oversight, the provider lists weren't compared on reconfiguration.

Reported-By: Ralph Covelli <rcovelli@he.net>
2025-01-09 01:08:59 +01:00
Ondrej Zajicek
96ec6b42d2 CI: Cleanup tests for single protocol builds
BFD and MRT can be built independently, only BMP requires BGP.
2025-01-09 00:51:25 +01:00
Ondrej Zajicek
c633cd1502 BMP: Cleanup keyword declarations 2025-01-09 00:51:25 +01:00
Ondrej Zajicek
c386369645 BFD: Fix missing keyword declarations
Some keywords were missing for BFD-only build.
2025-01-09 00:51:23 +01:00
Maria Matejka
96dc63d602 CI: test building single protocols
Several users build BIRD with excluded support for protocols they don't
need. Testing single-protocol builds; the assumption is that if single
protocols and all protocols are buildable, then possibly any reasonable
combination is buildable as well.

Minor change by committer.
2024-12-17 09:39:19 +01:00
Maria Matejka
59759c6c7d Fixed several tests which needed static protocol
Now they need device protocol which is always built.
2024-12-17 09:28:38 +01:00
Maria Matejka
67eb386828 Disabling filter test unless needed protocols are configured 2024-12-17 09:28:38 +01:00
Ondrej Zajicek
8d062e9312 Nest: Fix handling of 64-bit rte_src.private_id
The commit 21213be523baa7f2cbf0feaa617f265c55e9b17a expanded private_id
in route source to u64, but forgot to modify function arguments, so it
was still cropped at 32-bit, which may cause some collisions for L3VPN.
This patch fixes that.
2024-12-17 09:00:42 +01:00
Ondrej Zajicek
7e65bb83c7 Doc: Fix protocol outline in RPKI
Protocol outlines should not contain specific values.

Also fix some space intendation in code sections.
2024-12-16 19:29:27 +01:00
Ondrej Zajicek
161aef353a Lib: Ensure that all net_addr structures have the same alignment
Also weaken the explicit alignment of net_addr to be u32, as VPN
is already u32-aligned.
2024-12-16 18:56:30 +01:00
Ondrej Zajicek
34b7d77e06 Lib: Data type for VPN route distinguishers
Use a distinct data structure for VPN route distinguishers instead
of just u64.
2024-12-16 18:27:42 +01:00
Ondrej Zajicek
e0ed978e75 Netlink: Handle onlink flag on BSD-Netlink
On BSD, the onlink flag is not tracked or reported by kernel. We are
using an heuristic that assigns the onlink flag to routes scanned from
the kernel. We should use the same heuristic even in BSD-Netlink
case, as the onlink flag is not reported here too.

Thanks to Björn König for the original patch.
2024-12-12 04:04:07 +01:00
Ondrej Zajicek
38a422d489 Build: Fix newlines in build of proto-build.c
Add newlines to the body of proto-build.c . Use printf instead of echo
for portable handling of backslash sequences.

Thanks to CCX for the change.
2024-12-10 14:58:05 +01:00
Fabian Bläse
cfac0076fb Babel: fix seqno wrapping on seqno request
The Babel seqno wraps around when reaching its maximum value (UINT16_MAX).
When comparing seqnos, this has to be taken into account. Therefore,
plain number comparisons do not work.
2024-12-10 02:14:06 +01:00
Ondrej Zajicek
6a55359b1e BGP: Graceful restart timer overrides
Implement several options (min/max graceful restart time, min/max long
lived stale time) to override graceful restart and long-lived graceful
restart timer values, as suggested by RFC 9494.
2024-12-06 04:06:16 +01:00
Ondrej Zajicek
fc5d06c28d BGP: Update LLGR draft references to RFC 9494 2024-12-05 16:42:49 +01:00
Ondrej Zajicek
1dbee120d3 CI: Fix filter tests for ASPA
(broken by previous change)
2024-12-03 17:23:09 +01:00
Ondrej Zajicek
c926a6e105 Static: Fix ASPA static route argument
It seems that it should be 'providers' instead of 'provider'.

It matches keyword declaration and documentation. Mismatch beween keyword
declaration also breaks static-only builds.
2024-12-03 17:05:23 +01:00
Ondrej Zajicek
4fb8fe6f53 NEWS and version update v2.16 2024-12-03 15:12:50 +01:00
Maria Matejka
b8008791cd Documentation: Updating roadmap as of end of 2024 2024-12-03 15:10:14 +01:00
Maria Matejka
707cad6188 CLI: Dumping forces new file creation instead of truncating. 2024-12-03 10:57:10 +01:00
Maria Matejka
2ab3f22e4a CLI: show memory also displays cold pages
Minor changes by committer.
2024-12-03 04:07:53 +01:00
Ondrej Zajicek
ef45611850 RPKI: Fix several errors in handling of Error PDU
Fix several errors including:
 - Unaligned memory access to 'Length of Error Text' field
 - No validation of 'Length of Encapsulated PDU' field
 - No validation of 'Error Code' field
 - No validation of characters in diagnostic message
2024-12-03 01:19:44 +01:00
Ondrej Zajicek
89d548accb RPKI: Increase max PDU length to 64k
APSA records can be arbitrarily large, let's use 64k as
a reasonable limit.
2024-12-02 07:06:34 +01:00
Maria Matejka
d85fa48e3a Slab: Write out all block pointers when asked for dump 2024-12-02 06:54:54 +01:00
Maria Matejka
ceab028326 Linpool: Write out all block pointers when asked for dump 2024-12-02 06:54:54 +01:00
Maria Matejka
da8a23277e CLI: Dumping internal data structures to files, not to debug output
All the 'dump something' CLI commands now have a new mandatory
argument -- name of the file where to dump the data. This allows
for more flexible dumping even for production deployments where
the debug output is by default off.

Also the dump commands are now restricted (they weren't before)
to assure that only the appropriate users can run these time consuming
commands.
2024-12-02 06:54:54 +01:00
Maria Matejka
4dd5b3d90e Logging: exposing vlog() to log va_lists 2024-12-02 04:27:30 +01:00
Maria Matejka
145830bdc8 CLI: adding cli_vprintf() 2024-12-02 04:27:30 +01:00
Maria Matejka
946386f2dd MRT: instead of crashing, ignore non-BGP attributes 2024-12-02 04:27:30 +01:00
Maria Matejka
7ee27418a7 Printf: impossible buffer overflow fix
When printing near the end of the buffer, there was an overflow in two cases:

(1) %c and size is zero
(2) %1N, %1I, %1I4, %1I6 (auto-fill field_width for Net or IP), size is
    more than actual length of the net/ip but less than the auto-filled
    field width.

Manual code examination showed that nothing could have ever triggered
this behavior. All older versions of BIRD, including BIRD 3 development
versions, are totally safe. This exact overflow has been found while
implementing a new feature in later commits.
2024-12-02 04:27:30 +01:00
Ondrej Zajicek
a47704a53d BMP: Refactor route monitor message serialization
Instead of several levels of functions, just have two functions
(one for routes, the other for end-of-rib), this allows to create
messages in a simple linear fashion.

Also reduce three duplicite functions to construct BGP header for
BMP messages to just one.
2024-12-02 03:38:17 +01:00
Ondrej Zajicek
73e7d3f5ce BMP: Refactor computation of message length
Fill message length after the message is created instead of computing
it beforehand. Also rename some functions to fit common pattern.
2024-12-02 03:38:17 +01:00
Ondrej Zajicek
5205ff9744 BMP: Refactor per-peer header arguments
Put all arguments for per-peer header into one structure instead of
passing them around as a lump of arguments. Also simplify code for
peer flags.
2024-12-02 03:38:17 +01:00
Maria Matejka
e6a100b31a BMP: simplified update queuing and better memory performance
This commit is quite a substantial rework of the underlying layers in
BMP TX:

- several unnecessary layers of indirection dropped, including most of
  the original BMP's buffer machinery
- all messages are now written directly into one protocol's buffer
  allocated for the whole time big enough to fit every possible message
- output blocks are allocated by pages and immediately returned when
  used, improving the overall memory footprint
- no intermediary allocation is done from the heap altogether
- there is a documented and configurable limit on the TX queue size
2024-12-02 03:38:17 +01:00
Maria Matejka
460321cfe9 Formatting numbers with order prefixes
Unit tests by Ondrej Zajicek.
2024-11-29 16:06:07 +01:00
Maria Matejka
c48a7ac0cc BMP: drop an unused mempool 2024-11-29 16:06:07 +01:00
Maria Matejka
3ca6e03db7 RPKI: refactored pdu to host byte order conversion
We shouldn't convert bytes 2 and 3 of the PDU blindly, there are several
cases where these are used by bytes. Instead, the conversion is done
only where needed.

This fixes misinterpretation bug of ASPA PDU flags on little endian
architectures.
2024-11-28 14:19:47 +01:00
Maria Matejka
54499f8850 String tests: fixed too strict strcmp checks
The strcmp function is not guaranteed to return -1 or +1
but any negative or positive value if the input strings
are different. Fixed the false assumption which triggered
a build bug on emulated arm64.
2024-11-27 12:01:58 +01:00