0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 18:08:45 +00:00
Commit Graph

5069 Commits

Author SHA1 Message Date
Maria Matejka
afb9d5d450 Channel: using a separate pool for export data 2023-10-12 11:38:23 +02:00
Maria Matejka
3cfa9ac253 Merge commit 'e2f08c382a2adbbbd94c5cd7d996ce9175e0fb9c' into HEAD 2023-10-12 11:38:16 +02:00
Maria Matejka
b708dd367a Merge commit '4972590e' into thread-next 2023-10-12 11:05:28 +02:00
Maria Matejka
e2f08c382a BGP/BMP: fixed build with no bmp at all 2023-10-12 10:57:55 +02:00
Maria Matejka
4972590ea5 BGP: dropped bgp_fix_attr_flags() (useless remnant from previous versions) 2023-10-12 09:29:09 +02:00
Maria Matejka
2cbf7c48ad Merge commit 'b20b6a9ad204f2648ed3d62720435bb21dfb947c' into thread-next 2023-10-11 22:26:41 +02:00
Maria Matejka
b20b6a9ad2 BGP/BMP: Moved temporary allocation checks to the freeing functions 2023-10-11 22:23:34 +02:00
Maria Matejka
65ced75e95 Merge branch 'mq-bmp-to-merge-to-v3' into thread-next 2023-10-11 22:06:18 +02:00
Maria Matejka
1b0f320371 Merge commit '2d988f71a5c3caf3b56426a45d4d234c4fd4fce7' into thread-next 2023-10-11 14:16:39 +02:00
Maria Matejka
4b5757ee52 Merge commit '6e908775' into thread-next 2023-10-11 13:28:30 +02:00
Maria Matejka
2ed9b2d769 Merge branch 'mq-bmp-to-merge-to-v3' into HEAD 2023-10-10 15:05:50 +02:00
Ondrej Zajicek
2d988f71a5 Nest: Use generic rte_announce() also for import tables
Remove special rte_announce_in(), so we can use generic rte_announce()
for bot feed and notifications.
2023-10-10 15:04:17 +02:00
Ondrej Zajicek
6e908775cb Conf: Improve handling of keywords
For whatever reason, parser allocated a symbol for every parsed keyword
in each scope. That wasted time and memory. The effect is worsened with
recent changes allowing local scopes, so keywords often promote soft
scopes (with no symbols) to real scopes.

Do not allocate a symbol for a keyword. Take care of keywords that could
be promoted to symbols (kw_sym) and do it explicitly.
2023-10-10 14:28:01 +02:00
Ondrej Zajicek
6b2c9b7c66 Conf: Fix symbol lookup
The symbol table used just symbol name as a key, and used a trick with
active flag to find symbols in active scopes with one hash table lookup.

The disadvantage is that it can degenerate to O(n) for negative queries
in situations where are many symbols with the same name in different
scopes.

Thanks to Yanko Kaneti for the bugreport.
2023-10-10 14:27:36 +02:00
Ondrej Zajicek
0e1fbaa5b2 NEWS and version update 2023-10-06 18:53:25 +02:00
Ondrej Zajicek
23f94b1368 Doc: Minor fixes 2023-10-06 18:52:02 +02:00
Ondrej Zajicek
c5c3a22bcc Conf: Bytestrings with hex: should use the same general format as ones without.
Either hex:01234567, or hex:01:23:45:67. No confusing formats like
hex:0123:4567🆎cdef, which looks like there is an implicit zero byte.
2023-10-06 04:59:47 +02:00
Pavel Šorejs
e83beb70bd KRT: Allow to learn routes with RTPROT_KERNEL
The Kernel protocol, even with the option 'learn' enabled, ignores
direct routes created by the OS kernel (on Linux these are routes
with rtm_protocol == RTPROT_KERNEL).

Implement optional behavior where both OS kernel and third-party routes
are learned, it can be enabled by 'learn all' option.

Minor changes by committer.
2023-10-06 04:55:56 +02:00
Ondrej Zajicek
57aa077227 BGP: Improve custom BGP attributes
- Implement EA_GET for custom BGP attributes
 - Forbid EA_SET on existing opaque attributes
 - Forbid redefining existing attributes
 - Document possible compatibility problems
2023-10-05 21:54:25 +02:00
Ondrej Zajicek
ba01a6f2e6 MPLS: Handle compatibility with old configs
Old configs do not define MPLS domains and may use a static protocol
to define static MPLS routes.

When MPLS channel is the only channel of static protocol, handle it
as a main channel. Also, define implicit MPLS domain if needed and
none is defined.
2023-10-05 17:54:43 +02:00
Ondrej Zajicek
de09fda5dc Filter: Fix scope handling in for loops
Changes in scope implementation broke scope handling in for loops.
The term in for loops is supposed to be parsed in the parent scope.
2023-10-05 14:26:22 +02:00
Ondrej Zajicek
abae806efd Conf: Fix 'show symbols'
Seems like the root scope was not marked as active.
2023-10-04 20:16:13 +02:00
Ondrej Zajicek
ab47c2ae46 BGP: Custom attribute definitions should use cfg_alloc(), not malloc()
Otherwise we would get memory leaks.
2023-10-04 20:16:13 +02:00
Maria Matejka
d41b06238d Filter: explicitly forbidden for-loop with pre-defined variable 2023-10-04 19:57:55 +02:00
Ondrej Zajicek
6a242b3ec6 IO: Fix race condition in event processing
When regular event was added from work event, we did remember that
regular event list was empty and therefore we did not use zero time
in poll(). This leads to ~3 s latency in route reload during
reconfiguration.
2023-10-04 17:36:03 +02:00
Ondrej Zajicek
0bfa216f49 Doc: Fix syntax errors in SGML 2023-10-04 15:25:05 +02:00
Ondrej Zajicek
be09b030ed MPLS: Update to support and use 64bit source id 2023-10-04 15:00:24 +02:00
Ondrej Zajicek
cab5fce2b6 Doc: L3VPN documentation 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
8a70885694 Doc: MPLS documentation 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
8f5511dafb L3VPN: Import/export target reconfiguration 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
d8130da86b BGP, L3VPN: Fix MPLS channel reload
When a MPLS channel is reloaded, it should reload all regular MPLS-aware
channels. This causes re-evaluation of routes in FEC map and possibly
reannouncement of MPLS routes.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
a7a9df8639 MPLS: Implement FEC map reconfiguration
This allows changing label policy or label range without restart.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
9b775859cd MPLS: Handle label allocation failures 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
e915f99e1c L3VPN: Fix bug in reconfiguration
Fields import_target / export_target link to config structures, must be
updated during reconfiguration.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
b6385decb3 MPLS: Improve handling of static label allocations
Use mpls_new_label() / mpls_free_label() also for static labels, to keep
track of allocated labels and to enforce label ranges.

Static label allocations always use static label range, regardless of
configured label range.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
81a20ca5d8 Static: Add syntax for static MPLS labels
Instead of just using route attributes, static routes with
static MPLS labels can be defined just by e.g.:

  route 10.1.1.0/24 mpls 100 via 10.1.2.1 mpls 200;
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
3572605151 MPLS: Label range non-intersection check 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
fcf2258620 MPLS: Improve label range reconfiguration
Allow to shorten label range over unused area.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
8e9e013b0d MPLS: Add command 'show mpls ranges'
Add command to show MPLS label ranges and their stats.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
3397ca51f8 Nest: Fix missing RTS_* values in filters 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
e338c4b63c Lib: Extend MPLS label allocator bitmap
Add function lmap_last_one_in_range() for finding the last active label
in a label range.
2023-10-04 13:07:33 +02:00
Ondrej Zajicek
bcff3ae79a L3VPN: BGP/MPLS VPNs using MPLS backbone
The L3VPN protocol implements RFC 4364 BGP/MPLS VPNs using MPLS backbone.
It works similarly to pipe. It connects IP table (one per VRF) with (global)
VPN table. Routes passed from VPN table to IP table are stripped of RD and
filtered by import targets, routes passed in the other direction are extended
with RD, MPLS labels and export targets in extended communities. A separate
MPLS channel is used to announce MPLS routes for the labels.
2023-10-04 13:07:28 +02:00
Ondrej Zajicek
9ca86ef69c MPLS: Add support for per-VRF labeling policy
The new labeling policy MPLS_POLICY_VRF assigns one label to all routes
(from the same FEC map associated with one VRF), while replaces their
next hops with a lookup to a VRF table. This is useful for L3VPN
protocol.
2023-10-04 13:01:21 +02:00
Ondrej Zajicek
9d456d5366 BGP: Add MPLS support
When MPLS is active, received routes on MPLS-aware SAFIs (ipvX-mpls,
vpnX-mpls) are automatically labeled according to active label policy and
corresponding MPLS routes are automatically generated. Also routes sent
on MPLS-aware SAFIs announce local labels when it should be done.
2023-10-04 13:01:21 +02:00
Ondrej Zajicek
15c86ed061 Static: Add MPLS support
When MPLS is active, static IP/VPN routes are automatically labeled
according to active label policy and corresponding MPLS routes are
automatically generated.
2023-10-04 13:01:21 +02:00
Ondrej Zajicek
333ddd4f98 MPLS subsystem
The MPLS subsystem manages MPLS labels and handles their allocation to
MPLS-aware routing protocols. These labels are then attached to IP or VPN
routes representing label switched paths -- LSPs.

There was already a preliminary MPLS support consisting of MPLS label
net_addr, MPLS routing tables with static MPLS routes, remote labels in
next hops, and kernel protocol support.

This patch adds the MPLS domain as a basic structure representing local
label space with dynamic label allocator and configurable label ranges.
To represent LSPs, allocated local labels can be attached as route
attributes to IP or VPN routes with local labels as attributes.

There are several steps for handling LSP routes in routing protocols --
deciding to which forwarding equivalence class (FEC) the LSP route
belongs, allocating labels for new FECs, announcing MPLS routes for new
FECs, attaching labels to LSP routes. The FEC map structure implements
basic code for managing FECs in routing protocols, therefore existing
protocols can be made MPLS-aware by adding FEC map and delegating
most work related to local label management to it.
2023-10-04 13:01:21 +02:00
Ondrej Zajicek (work)
e55696a4f8 Lib: Indirect bitmap for MPLS label allocator 2023-10-04 13:01:21 +02:00
Maria Matejka
198fb23a3a Merge commit '93509af4' into HEAD 2023-10-03 11:26:46 +02:00
katerina.kubecova
93509af4c1 Table preexport net-filter refactoring
Also added a possibility for filtering by trie.
2023-10-03 11:08:28 +02:00
katerina.kubecova
216abcb12e ROA notifications store the affected nets into trie 2023-10-03 11:07:46 +02:00