0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00
Commit Graph

5245 Commits

Author SHA1 Message Date
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
Maria Matejka
5daec239c4 Renamed my past self in commit authorship and mentioned that in the contributing policy 2024-08-29 14:38:58 +02:00
Maria Matejka
2ba6e797cc Fixed a stupid bug in parse-and-exit mode
Introduced in 08ff0af898, the additional CLI
configuration wasn't properly initialized in the parse-and-exit mode
due to an oversight that cli_init_unix() is not called in this mode.

Thanks to Felix Friedlander for the bugreport.
2024-08-29 14:37:19 +02:00
Fabrice Fontaine
404e82616d configure.ac: properly evaluate ac_test_CFLAGS
Since autoconf 2.69 and
https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=76754e04fce5f6a7701bec57b057020585df2ae3
ac_test_CFLAGS is set to ${CFLAGS+y} instead of ${CFLAGS+set}.

Just test that ac_test_CFLAGS is not empty, to support both cases.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2024-08-27 14:54:07 +02:00
Ondrej Zajicek
acbdc29d57 Lib: Expand timer recurrence to 64b
The period of recurent timers was stored in 32b field, despite it was
btime-compatible value in us. Therefore, it was limited to ~72 min,
which mas okay for most purposes, except configurable MRT dump periods.

Thanks to Felix Friedlander for the bugreport.
2024-08-27 14:28:41 +02:00
Ondrej Zajicek
5214d7e59f IO: Ensure that socket rcvbuf is large enough
The socket structure has the field rbsize (receive buffer size), which
controls the size of the userspace receive buffer. There is also kernel
receive buffer, which in some cases may be smaller (e.g. on FreeBSD it
is by default ~8k). The patch ensures that the kernel receive buffer is
as large as the userspace receive buffer.
2024-08-01 14:55:05 +02:00
Ondrej Zajicek
c9836207f5 IO: Fix missing return introduced in one of earlier patches 2024-07-30 16:42:32 +02:00
Ondrej Zajicek
df22b3140c IO: Avoid re-binding accepted sockets to VRF
When VRFs are used, BIRD correctly binds listening (and connecting)
sockets to their VRFs but also re-binds accepted sockets to the same VRF.
This is not needed as the interface bind is inherited in this case, and
indeed this redundant bind causes an -EPERM if BIRD is running as
non-root making BIRD close the connection and reject the peer.

Thanks to Christian Svensson for the original patch and Alexander Zubkov
for suggestions.
2024-07-30 16:33:51 +02:00
Maria Matejka
e787a9210f NEWS and version update 2024-07-01 15:34:06 +02:00
Maria Matejka
5ea6423cb9 Fixed secondary route export 2024-06-28 22:03:45 +02:00
Maria Matejka
d53582c9a1 show threads: displaying the same thread id's as in log 2024-06-28 22:03:45 +02:00