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

283 Commits

Author SHA1 Message Date
Maria Matejka
abcdde1b38 BGP: Simpler hashing in export table
We need a hashing simple enough to allow for feeding by netindex.
2024-06-04 10:11:36 +02:00
Maria Matejka
d01a7c2bda BGP: Export uses common attribute cache
There is no real need for storing bucket attributes locally and we may
save some memory by caching the attributes in one central place.

If this becomes a contention problem, we should reduce the lock load
of the central attribute cache.
2024-06-04 10:11:36 +02:00
Maria Matejka
73afffc464 BGP: pending TX prefixes link netindex instead of copying net_addr
This helps with memory consumption, allows for removal of multiple
slab/mblock ifs and prepares for easier feeds.
2024-06-04 10:11:36 +02:00
Maria Matejka
6f59a414b1 BGP: refactored pending TX back into channel 2024-06-04 10:11:36 +02:00
Maria Matejka
10bb1c1e9d Real almost-lockless feeds and more pull-like exports
Introducing a new omnipotent internal API to just pass route updates
from whatever point wherever we want.

From now on, all the exports should be processed by RT_WALK_EXPORTS
macro, and you can also issue a separate feed-only request to just get a
feed and finish.

The exporters can now also stop and the readers must expect that to
happen and recover. Main tables don't stop, though.
2024-06-04 10:11:36 +02:00
Maria Matejka
76ca53e4f8 SKIP_BACK_DECLARE: easier embedded-to-parent typecasting 2024-05-25 19:37:16 +02:00
Maria Matejka
091130e84b Using ea_lookup_tmp() for temporarily keeping attribute references
To avoid needs for keeping local temporary references for attributes,
now one can use ea_lookup_tmp() to ensure that the attributes are
valid and stored until the task ends. After that, the attributes are
automatically unref'd and also deallocated if needed.
2024-05-25 19:37:16 +02:00
Maria Matejka
83a409abd2 Cached route attributes now have explicitly marked layers
Also the rta_* functions renamed to ea_* functions
2024-05-22 11:34:34 +02:00
Maria Matejka
fe3d7c1a17 Merge a branch of fixes and updates needed for stabilization of v3.
Merge commit 'c06ce709' into HEAD
2024-05-19 11:28:03 +02:00
Maria Matejka
c3698535e3 BGP: Fixed corking of RX
If cork occurred after some incoming data had been already processed,
BGP incorrectly processed them again after uncorking because it forgot
to store the actual socket state.

Now storing the socket state (done at the end of bgp_rx()) and
therefore the bug is fixed.
2024-05-18 15:48:03 +02:00
Maria Matejka
ef16f07633 Fixed annoying undefined values with nexthops 2024-05-18 15:46:53 +02:00
Ondrej Zajicek
0bcc7a9316 Merge commit '44a16bff6cbf3f5ae8db21ffcec602bc51295d0a' into thread-next 2024-03-28 20:03:46 +01:00
Ondrej Zajicek
62c9f12dfc Merge commit '574d7eb241a60622b0573ab1460cb23d968ba1cc' into thread-next 2024-03-28 15:00:40 +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
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
Maria Matejka
058984bc86 BGP: fixed MPLS setting in nexthops
bug introduced somewhere during conversion of nexthops to eattrs
2024-01-29 22:12:38 +01:00
Maria Matejka
ddb4d9a24c Merge commit 'v2.14-95-g6d453c16' into thread-next 2024-01-28 15:04:45 +01:00
Maria Matejka
8b4f53675e Merge commit 'v2.14-92-gf27b05de' into thread-next 2024-01-28 15:00:59 +01:00
Maria Matejka
b5afbe057e Merge commit 'v2.14-89-g74de3858' into thread-next 2024-01-28 14:57:52 +01:00
Maria Matejka
6a80214fb3 BGP: fixed MPLS label stack receiving bug
Introduced in 515df18da7 while merging v2 to v3.
2024-01-28 13:16:25 +01:00
Katerina Kubecova
bcf2327425 BGP: Send hold timer
Implement BGP Send hold timer according to draft-ietf-idr-bgp-sendholdtimer.
The Send hold timer drops the session if the neighbor is sending keepalives,
but does not receive our messages, causing the TCP connection to stall.
2023-12-05 04:14:45 +01:00
Ondrej Zajicek
3fb06fea1d BGP: Add options to require BGP capabilities
Some BGP capabilities change the BGP behavior in a significant way, so if
the configuration depends on it, it is better to not establish BGP
session when the capability is not available.

Add several BGP option to require individual BGP capabilities during
session negotiation.
2023-11-23 20:54:22 +01:00
Ondrej Zajicek
b6923f6386 BGP: Simplify capability handling 2023-11-23 17:18:04 +01:00
Maria Matejka
515df18da7 Merge branch 'mq-aggregator-for-v3' into thread-next 2023-11-08 22:24:33 +01:00
Maria Matejka
f90f2ed680 Merge branch 'mq-aggregator-for-v3' into thread-next 2023-11-01 18:08:49 +01:00
Maria Matejka
d8463ca7d9 Merge branch 'mq-aggregator-for-v3' into thread-next 2023-11-01 17:48:00 +01:00
Maria Matejka
ddf698ec99 Renamed nest/rt.h back to nest/route.h
Some [redacted] (yes, myself) had a really bad idea
to rename nest/route.h to nest/rt.h while refactoring
some data structures out of it.

This led to unnecessarily complex problems with
merging updates from v2. Reverting this change
to make my life a bit easier.

At least it needed only one find-sed command:

    find -name '*.[chlY]' -type f -exec sed -i 's#nest/rt.h#nest/route.h#' '{}' +
2023-10-29 16:29:26 +01:00
Maria Matejka
21b75c472d Merge commit 'e3c0eca9' into thread-next 2023-10-13 11:04:39 +02:00
Maria Matejka
767b7b22a0 Merge commit '5121101136cb80151a9361c63dc4822afeb44eef' into thread-next 2023-10-12 14:12:33 +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
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
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
Maria Matejka
8d1215dba6 Channel: Refeeding by an auxiliary request if needed.
If the protocol supports route refresh on export, we keep the stop-start
method of route refeed. This applies for BGP with ERR or with export
table on, for OSPF, Babel, RIP or Pipe.

For BGP without ERR or for future selective ROA reloads, we're adding an
auxiliary export request, doing the refeed while the main export request
is running, somehow resembling the original method of BIRD 2 refeed.

There is also a refeed request queue to keep track of different refeed
requests.
2023-10-03 09:54:39 +02:00
Ondrej Zajicek
21213be523 Nest: Expand rte_src.private_id to u64
In general, private_id is sparse and protocols may want to map some
internal values directly into it. For example, L3VPN needs to
map VPN route discriminators to private_id.

OTOH, u32 is enough for global_id, as these identifiers are dense.
2023-10-02 15:09:30 +02:00
Maria Matejka
8ad9c4bb33 BGP config: Splitting Route Refresh and Enhanced Route Refresh
Both toggles are on by default but if some implementation needs one or
another to be switched off separately, then it's possible now.
2023-09-27 20:18:46 +02:00
Ondrej Zajicek
e3c0eca956 Nest: Treat VRF interfaces as inside respective VRFs
Despite not having defined 'master interface', VRF interfaces should be
treated as being inside respective VRFs. They behave as a loopback for
respective VRFs. Treating the VRF interface as inside the VRF allows
e.g. OSPF to pick up IP addresses defined on the VRF interface.

For this, we also need to tell apart VRF interfaces and regular interfaces.
Extend Netlink code to parse interface type and mark VRF interfaces with
IF_VRF flag.

Based on the patch from Erin Shepherd, thanks!
2023-08-23 16:08:40 +02:00
Ondrej Zajicek
5121101136 Merge branch 'bmp' 2023-08-22 15:28:05 +02:00
Ondrej Zajicek
9bf2048476 BGP: Update RFC reference
RFC 5549 was obsoleted by RFC 8950.
2023-08-22 14:20:59 +02:00
Ondrej Zajicek
4558adabfb BMP: Improve peer_down handling
Move all bmp_peer_down() calls to one place and make it synchronous with
BGP session down, ensuring that BMP receives peer_down before route
withdraws from flushing.

Also refactor bmp_peer_down_() message generating code.
2023-08-22 01:26:06 +02:00
Ondrej Zajicek
8ded8baba2 BMP: Simplify route monitoring hooks
No need for *_begin(), *_commit(), and *_end() hooks. The hook *_notify()
is sufficient for everything.
2023-08-01 18:38:02 +02:00
Ondrej Zajicek
e8838d930c BMP: Support multiple instances of BMP protocol
Add internal BMP functions with plicit bmp_proto *p as first argument,
which allows using TRACE() macro. Keep list of BMP instances and call
internal functions. Old BMP functions are wrappers that call internal
functions for all enabled BMP instances.

Extract End-of-RIB mark into separate function.

Based on patch from Michal Zagorski <mzagorsk@akamai.com>. Thanks!
2023-06-08 05:03:15 +02:00
Ondrej Zajicek
c1821a9aba BGP: Improve bgp_create_update_bmp()
Fix issue with missing AF cap (e.g. IPv4 unicast when no capabilities
are announced).

Add Linpool save/restore action similar to bgp_create_update().

Based on patch from Michal Zagorski <mzagorsk@akamai.com> co-authored
with Pawel Maslanka <pmaslank@akamai.com>. Thanks!
2023-05-30 15:37:52 +02:00
Ondrej Zajicek
f8ba82804f BGP: Fix role check when no capability option is present
When an OPEN message without capability options was parsed, the remote
role field was not initialized with the proper (non-zero) default value,
so it was interpreted as if 'provider' was announced.

Thanks to Mikhail Grishin for the bugreport.
2023-05-19 01:02:57 +02:00
Maria Matejka
7d8e541057 Linpool state save and restore refactoring 2023-05-06 10:50:31 +02:00
Ondrej Zajicek
aa3c35498d BMP: Use OPEN messages stored in BGP
The BMP protocol needs OPEN messages of established BGP sessions to
construct appropriate Peer Up messages. Instead of saving them internally
we use OPEN messages stored in BGP instances. This allows BMP instances
to be restarted or enabled later.

Because of this change, we can simplify BMP data structures. No need to
keep track of BGP sessions when we are not started. We have to iterate
over all (established) BGP sessions when the BMP session is established.
This is just a scaffolding now, but some kind of iteration would be
necessary anyway.

Also, the commit cleans up handling of msg/msg_length arguments to be
body/body_length consistently in both rx/tx and peer_up/peer_down calls.
2023-05-01 04:01:16 +02:00
Ondrej Zajicek
1be0be1b71 BGP: Save sent and received OPEN messages
These are necessary for BMP Peer UP message and it is better to keep them
in BGP than in BMP (so BMP could be restarted or added later).
2023-05-01 04:01:16 +02:00