0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00
Commit Graph

1733 Commits

Author SHA1 Message Date
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
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
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
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
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
946386f2dd MRT: instead of crashing, ignore non-BGP attributes 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
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
01377599da RPKI: Polishing of ASPA syntax and documentation 2024-11-26 18:11:39 +01:00
Ondrej Zajicek
fb919ac2a2 RPKI: Fix PDU length check
The END_OF_DATA PDU was extended in version 1, so it has different length
in different versions. We should do the PDU length check according to its
version.
2024-11-26 17:52:51 +01:00
Maria Matejka
e330fb1614 RPKI: added documentation and RTR version config options 2024-11-26 04:47:33 +01:00
Katerina Kubecova
fa65e06372 RPKI: protocol version 2, loading ASPA
Implemented draft-ietf-sidrops-8210bis-16, interoperable with StayRTR
development branches.
2024-11-26 04:14:36 +01:00
Piotr Wydrych
82d57fb7ad CLI: Add timeformat command
Adds ability to override time format of show commands for current CLI session
so that it does not depend on configuration and may ease parsing when CLI is
called from tools.

Minor changes by committer.
2024-11-07 15:08:51 +01:00
Maria Matejka
38195ac628 ASPA: fixed the check algorithm to actually do what is in the RFC
The original algorithm assumed principles not consistent with the RFC
and could have lead to false invalids.

Also added filter tests showing also how the ASPA literals are used in
the static protocol.
2024-11-07 15:08:14 +01:00
Ondrej Zajicek
c7e843c1a7 BGP: Add RFC 9687 to list of supported RFCs 2024-11-07 15:07:22 +01:00
Maria Matejka
b4196b70c4 BGP: SendHoldTimer became an RFC, updating docs 2024-11-06 13:05:32 +01:00
Job Snijders
8dc2a36ae5 RPKI: Add TCP-MD5 authentication option
RPKI-To-Router (RTR) sessions seem to be similar security-sensitivity as
IBGP sessions. BIRD already offered a choice of either "plain TCP" (meh)
or "SSH" (secure, albeit a bit more hassle to set up than TCP-MD5).
The patch adds TCP-MD5 as another option. TCP-MD5 for RTR is specified
through RFC 6810 section 7.3 and RFC 8210 section 9.3.

Minor changes by committer.
2024-10-03 16:25:29 +02:00
Alexander Zubkov
8a40bccffe BFD: Add option to accept zero checksum for IPv6 UDP packets
Some vendors do not fill the checksum for IPv6 UDP packets.
For interoperability with such implementations one can set
UDP_NO_CHECK6_RX socket option on Linux.

Thanks to Ville O for the suggestion.

Minor changes by committer.
2024-06-26 16:29:57 +02:00
Ondrej Zajicek
e29f134ad9 BFD: Fix build when BFD is disabled
Move bfd_opts grammar inside BFD parser code to avoid dependences between
nest and BFD grammars, which breaks when BFD build is disabled.

Add dummy bfd_opts grammar rule, so protocols can use this nonterminal
even with BFD disabled.

Thanks to Yuri Honegger for the bugreport.
2024-05-28 15:31:52 +02:00
Katerina Kubecova
e6dbde6883 BFD: Set password per session 2024-04-16 15:30:59 +02:00
Ondrej Zajicek
280daed57d OSPF: Allow loopback nexthop in OSPFv3-IPv4
In OSPFv3-IPv4 there is no requirement that link-local next hop announced
in Link-LSA must be in interface address range. Therefore, for interfaces
that do not have IPv4 address we can use some loopback IP address and
announce it as a next hop. Also we should accept such address.
2024-04-04 18:37:26 +02:00
Maria Matejka
08571b2059 ASPA: basic data structures and Static protocol support 2024-03-25 14:15:30 +01:00
Maria Matejka
b95dc8f29f Expanded usage of stdbool.h to the whole BIRD 2024-03-25 09:39:58 +01:00
Ondrej Zajicek
a698f8d917 Static: Fix invalid combination of nexthop options
BFD requires defined local IP, but for nexthop with onlink there might
not be such address. So we reject this combination of nexthop options.
This prevent crash where such combination of options is used.
2024-03-22 00:40:06 +01:00
Ondrej Zajicek
d21a508e8d Revert "OSPF: On physical PtP links, skip next-hop resolving"
This reverts commit 31aa62ae6d.
2024-03-21 15:59:26 +01:00
Ondrej Zajicek
46a4932574 Merge commit '44e351d1522f0099687aac9fd65dcea73a04af43' 2024-03-21 15:58:52 +01:00
Ondrej Zajicek
66d6ac7085 Babel: Fix build with limited set of protocols 2024-03-19 15:39:46 +01:00
Ondrej Zajicek
06209c1917 Aggregator: Fix build with limited set of protocols 2024-03-19 15:39:19 +01:00
Michal Zagorski
099898ffdd Static: Fix build with limited set of protocols 2024-03-11 12:57:13 +01:00
Ondrej Zajicek
1b064355f7 Client: Add support for completion of command options
We can easily extend command completion to handle also keywords for
command options. Help for command options is not yet supported.
2024-03-05 19:04:10 +01:00
Ondrej Zajicek
26dd61ee7f BFD: Add arguments to 'show bfd sessions' command
Add several arguments to 'show bfd sessions' command to filter
the list of sessions.
2024-03-05 00:02:16 +01:00
Ondrej Zajicek
4737937375 BFD: Improve 'show bfd sessions all' command 2024-03-04 23:51:37 +01:00
Katerina Kubecova
a48dc5efe0 BFD: Show session for ip / ip prefix 2024-03-04 23:35:10 +01:00
Katerina Kubecova
37bf207843 BFD: show bfd sessions all 2024-03-04 23:35:10 +01:00
Job Snijders
e2728c8078 RPKI: Add 'local address' configuration option
Allow to explicitly configure the source IP address for RPKI-To-Router
sessions. Predictable source addresses are useful for minimizing the
holes to be poked in ACLs.

Changed from 'source address' to 'local address' by committer.
2024-02-22 14:58:29 +01:00
Ondrej Zajicek
2d0652dd10 BGP: Maintain valid route attribute flags even in local tables
BGP route attributes have flags (Optional, Transitive) that are validated
on decode and set to valid value on export. But if such attribute is
modified by filter or set internally by BGP during import, then its flags
would be zero in local tables. That usually does not matter, as they are
not used locally and they were fixed on export, but invalid flags leaked
in BMP and MRT dumps.

Keep route attribute flags set to valid values even when set by filters
or modified by BGP.
2024-02-20 17:39:05 +01:00
Job Snijders
44a16bff6c BGP: Update SendHoldTimer BGP Error code
IANA registered an "Early Allocation" BGP Error code for 'Send Hold
Timer Expired' event. Update BIRD to use that error code.
2024-02-18 09:06:52 +01:00
Ondrej Zajicek
c3335b5044 Static: Allow to define both nexthop and interface
Allow to define both nexthop and interface using iproute2-like syntax,
e.g.: route 10.0.0.0/16 via 10.1.0.1 dev "eth0";

Now we can avoid to use link-local scope hack (e.g. 10.1.0.1%eth0)
for cases where both nexthop and interface have to be defined.

Thanks to Marcin Saklak for the suggestion.
2024-02-16 18:44:40 +01:00
Alexander Zubkov
574d7eb241 BGP: Allow multiple EBGP neighbors with the same peer.
We can distinguish BGP sessions if at least one side uses a different IP
address. Extend olock mechanism to handle local IP as a part of key, with
optional wildcard, so BGP sessions could local IP in the olock and not
block themselves.
2024-02-07 19:11:10 +01:00
Ondrej Zajicek
ff2ebdc7e1 BGP: Increase max length of notification data in error logs
Increase max length of notification data in error logs from 16 to 128.
There is already enough space in the buffer.

Thanks to Marco d'Itri for the suggestion.
2024-02-06 18:34:55 +01:00
Ondrej Zajicek
13c6cf8a74 Trivial code cleanups 2024-01-22 06:29:14 +01:00
Maria Matejka
44e351d152 RPKI: retry timer doesn't reset connections when more data is pending
With very busy deployments, RPKI may kill cache connection too early.
Instead of that, we want it to keep loading if any data is waiting to
be read and the reason for delay is just our congestion.

Also, when we kill the session because of actually slow cache, we want
to reload from scratch as the data we have is unreliable and nobody
knows whether the state is still valid.
2023-12-20 11:58:07 +01:00
Ondrej Zajicek
2b6bd8ca3a OSPF: Cleanup some warnings 2023-12-13 18:07:38 +01:00