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

5255 Commits

Author SHA1 Message Date
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
Ondrej Zajicek
fc2b4b26a6 Fixed crash if logging happened in unit tests
The patch initializes logging in unit tests. Previously, unit tests did
not initialize logging and other subsystems, just resources. But
resource_init() could under certain circumstances trigger logging and
cause crash.

The bug was Found by Jakub Ruzicka, dissected by David Petera and Maria
Matejka, disguised as failing build for Debian arm64 in pbuilder
emulation which did not like disabling THP.

Fixes #42.
2024-11-27 04:15:16 +01:00
Maria Matejka
997d2f578e ASPA: Unified the ASPA_INVALID into one result
The _EMPTY and _CONFED variants are easy to spot bare-eyed from the AS path.
2024-11-26 20:33:28 +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
Maria Matejka
1dd21f6024 Netlink: Fixed handling of undefined bitfields in filters
The default value is obviously false everywhere so we just return zero
if nothing is found, instead of undef.
2024-11-25 17:14:32 +01:00
Maria Matejka
7491cdbd1d Filter: multi-command case branches now need braces.
Removing an exception from the otherwise quite systematic syntax.
Closes #111.
2024-11-25 17:06:24 +01:00
Katerina Kubecova
99fa1f01a4 rt-show.c: fixed OBSREF_SET after cf_error(), changed message when 'show route export' called on static protocol 2024-11-25 17:06:24 +01:00
Maria Matejka
3f4332f0bd Protocol restart timer reworked.
The restart timer was racy and didn't allow for immediate restarts
from limits. Now the protocols stores the last restart time and in case
of too frequent autorestarts caused by exceeded limits, the protocol
gets disabled with an error message.

Also now there is a configuration knob for this.
2024-11-25 17:06:24 +01:00
Maria Matejka
53431ff679 Hash test spurious fail fixed
There was a race condition in the test itself,
causing the test reader access data after free.
2024-11-25 09:44:00 +01:00
Maria Matejka
2956faf5a6 Protocol and BGP state information cleanup and fixes
There were some nasty problems with deferred protocol state updates and
race conditions on BGP startup, shutdown, and also with referencing the
cached states.

Now it looks fixed.
2024-11-24 22:51:08 +01:00
Maria Matejka
e654efd354 Debug option for ea_free 2024-11-24 22:49:39 +01:00
Maria Matejka
6ba06dc4df Deferred call may need to be returned for future cleanups 2024-11-24 22:49:35 +01:00
Katerina Kubecova
77dee46e98 BMP: updated to v3 API 2024-11-21 10:29:10 +01:00
Maria Matejka
d2ad795c1e BGP: protocol specific state information cleanup 2024-11-21 09:21:29 +01:00
Maria Matejka
74800729c0 Proto: The active flag converted to actual fifth protocol state
What was PS_DOWN before, is now PS_DOWN and PS_FLUSH.
2024-11-18 22:21:12 +01:00
Katerina Kubecova
7889f0c25b Neighbor locking: forgotten neighbors to unlink are actually a bug.
These may cause runaway pointers.
2024-11-18 10:09:36 +01:00
Katerina Kubecova
ca5ed6997c nest/cli: fixup - empty printing in birdc does not freeze 2024-11-15 10:04:51 +01:00
Katerina Kubecova
dc69284f61 MRT: buildable and running again for BIRD 3
Tests for MRT are scarce and not automated for now, so it may behave
weirdly in corner cases.
2024-11-14 11:41:37 +01:00
Maria Matejka
eb6918e4db Neighbor cache: fixed neighbor referencing 2024-11-14 11:41:37 +01:00
Maria Matejka
03f51079c1 Defer: fixup missing include guards 2024-11-14 11:41:37 +01:00
Katerina Kubecova
c0319183a5 BGP: exporting protocol-specific state information 2024-11-14 11:41:37 +01:00
Maria Matejka
fa75007156 BGP: Start state is now using extended state 2024-11-14 11:41:37 +01:00
Katerina Kubecova
b97d924e52 Proto: adding lockless state table and journal
To allow reading of protocol states from other protocols or completely
different routines, we have to export these states to data structures
not requiring to lock the protocol loops.

On one hand, this doesn't give the reader the actual state "right now",
on the other hand, getting that is impossible in a properly
multithreaded environment and you will always get the information with
some (little but noteworthy) delay.

This implementation handles only the basic state information of the
protocols, common for all the protocols. Adding protocol-specific state
information should be done by implementing the protocol hook init_state().

Channel information is stored but not announced, as we don't need the
announcements for now.
2024-11-14 11:41:37 +01:00
Katerina Kubecova
224fbe5980 ASPA: Automatic channel reload 2024-11-09 16:51:06 +01:00
Katerina Kubecova
330c71bd0a More attribute types: pointers, strings, btime
For the upcoming rework of protocol state information propagation,
we need some more eattr types to be defined.

These types are probably not defined completely and before using
them for route attributes, you should check that they don't lack
some crucial methods.
2024-11-09 09:55:40 +01:00
Ondrej Zajicek
49be4a0329 Lib: Optimized printing of numbers
One simple trick makes printing of numbers ~4x faster.
2024-11-08 18:54:13 +01:00
Ondrej Zajicek
5c6572c422 Lib: Optimized printing of IP addresses
Makes printing network prefixes ~15x faster.
2024-11-08 18:51:54 +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
Ondrej Zajicek
9eca3e1a2e Nest: Cleanup timeformat grammar 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
Ondrej Zajicek
294d363da0 Filter: Remove T_ENUM_RTC
It is not used for a long time.
2024-10-18 16:53:12 +02:00
Ondrej Zajicek
1002c35bf9 Filter: Replace T_ENUM_NETTYPE with T_ENUM_NET_TYPE
To be consistent with other enum type names.
2024-10-18 16:49:19 +02:00
Ondrej Zajicek
80ca0ed279 Filter: Add enum types to filter grammar
Enum types existed on semantic level, but not on syntactic level,
so they could not be used in filter code.

Generate filter grammar for enum types based on CF_ENUM() declarations.

Thanks to lbz for the bugreport.
2024-10-18 16:39:42 +02:00
Eric Long
072821e55e Flowspec: Fix IPv6 prefix when offset is not multiple of 8
Current implementation handles flowspec prefix length and offset only
in bytes, but RFC 8956 (Dissemination of Flow Specification Rules for
IPv6) Section 3.1 [1] and example in Section 3.8.2 [2] states the
pattern should begin right after offset *bits*.

For example, pattern "::1:1234:5678:9800:0/60-104" is currently
serialized as "02 68 3c 01 12 34 56 78 98", but it should shift its
pattern 4 more bits to the left: "02 68 3c 11 23 45 67 89 80".

This patch implements shifting left/right for IPv6 type and use it to
correct the behaviour. Test data are replaced with the correct ones.

Minor changes and test vectors done by committer.

[1]: https://www.rfc-editor.org/rfc/rfc8956.html#section-3.1
[2]: https://www.rfc-editor.org/rfc/rfc8956.html#section-3.8.2
2024-10-16 21:32:36 +02:00
Ondrej Zajicek
6f9ccfae9e Flowspec: Test improvements
Simplify Flowspec initialization macros.

Add examples from RFC 8955 4.3 and RFC 8956 3.8 to format tests.
2024-10-16 04:04:46 +02:00
Ondrej Zajicek
a70ecadefe Doc: Minor fixes 2024-10-15 17:19:42 +02:00
Ondrej Zajicek
cb40a666b9 Doc: Fix code blocks
Code blocks should not be indented, as the indendation is passed
to the output,
2024-10-15 17:17:10 +02:00
Johannes Erwerle
72c2df562d Doc: Improve readability of the operator documentation
Minor changes by committer.
2024-10-15 17:17:06 +02:00
Maria Matejka
02de88de41 Table: tame warnings around unused debug messages 2024-10-11 12:23:52 +02:00
Ondrej Zajicek
48a620a916 Fix typo in documentation 2024-10-09 18:00:16 +02:00
Ondrej Zajicek
39e75b879b Filter: Fixes and improvements related to case/sets
Unify grammar for set_atom and switch_atom to avoid inconsistencies
between them. Fix errors in documentation related to case statement
and set type. Change 'vpnrd' to 'rd' to be consistent with the filter
language.

Thanks to Mikhail Mayorov for bugreport.
2024-10-08 19:44:17 +02:00
Ondřej Zajíček
163ab3130f Merge branch 'dpetera-master-patch-71179' into 'master'
Fix typo in user docs

See merge request labs/bird!27
2024-10-07 16:35:55 +02:00
David Petera
d4929d9113 Fix typo in user docs 2024-10-07 16:15:09 +02: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
Katerina Kubecova
716472957b Kernel: protocol shuts down synchronously
Before this commit, on kernel shutdown, the routes were re-exported by
the regular export but treated as withdraw. This was too hairy and
caused unnecessary complexity of the protocol's state machine.

Instead of that, we found out that it makes more sense to just refeed
the routes synchronously and convert to withdraw. This is done by the
direct export access instead of the channel.

It would (maybe) make more sense to run export filters on this in case
the export filter updates the krt_metric attribute, but as this doesn't
work on regular withdraw anyway, it's better for now to just let it be
and maybe somebody in the future fixes this issue.
2024-09-30 10:04:36 +02:00