0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-19 11:55:21 +00:00
Commit Graph

4474 Commits

Author SHA1 Message Date
Andreas Rammhold
eecc3f02e4 Babel: Implement IPv4 via IPv6 extension (RFC 9229)
The patch implements an IPv4 via IPv6 extension (RFC 9229) to the Babel
routing protocol (RFC 8966) that allows annoncing routes to an IPv4
prefix with an IPv6 next hop, which makes it possible for IPv4 traffic
to flow through interfaces that have not been assigned an IPv4 address.

The implementation is compatible with the current Babeld version.

Thanks to Toke Høiland-Jørgensen for early review on this work.

Minor changes from committer.
2023-02-14 16:17:03 +01:00
Maria Matejka
9508cd85ce Protocol shutdown/restart from limits is respecting the loops 2023-02-07 14:28:25 +01:00
Maria Matejka
a2fd889a3b Merge commit '0bb04d5390f21b0c96fc4894ba5d5510c541f0ef' into HEAD 2023-02-07 14:27:23 +01:00
Maria Matejka
0bb04d5390 BGP: opening and closing listening socket asynchronously 2023-02-07 11:52:03 +01:00
Maria Matejka
0851fcde65 Documentation: Adding roadmap as decided in January 2023 2023-02-03 09:12:34 +01:00
Maria Matejka
597a4b33a7 Macro: stringify 2023-02-02 15:57:21 +01:00
Maria Matejka
226839c977 Lists: fixed bugs in expensive checks in quirky usecases 2023-02-02 15:57:21 +01:00
Maria Matejka
c354e8f4c1 Interface updates are asynchronous
Instead of propagating interface updates as they are loaded from kernel,
they are enqueued and all the notifications are called from a
protocol-specific event. This change allows to break the locking loop
between protocols and interfaces.

Anyway, this change is based on v2 branch to keep the changes between v2
and v3 smaller.
2023-02-02 15:57:21 +01:00
Maria Matejka
64e0877525 Proto: Adding a list of associated neighbors
This makes for safer and faster pruning and notifying as protocol now on
its shutdown prunes only its neighbors and nothing else.
2023-02-02 14:40:00 +01:00
Maria Matejka
6e035a9a8c Typed lists: shortcut for simple nodes 2023-02-02 14:40:00 +01:00
Maria Matejka
e077d0e770 Moved interface list flush to device protocol cleanup hook.
The interface list must be flushed when device protocol is stopped. This
was done in a hardcoded specific hook inside generic protocol routines.
The cleanup hook was originally used for table reference counting late
cleanup, yet it can be also simply used for prettier interface list flush.
2023-02-02 14:40:00 +01:00
Ondrej Zajicek
0ab62f2674 Build: Partial revert of one of previous changes
There are many compatibility issues with echo -e, scratch that.
2023-02-01 19:30:21 +01:00
Ondrej Zajicek
ba348b2029 Build: Minor improvement to build output 2023-02-01 17:47:17 +01:00
Ondrej Zajicek
23f3dd5cfb Nest: Minor cleanup in buildsystem
There ware missing dependencies for proto-build.c generation, which
sometimes lead to failed builds, and ignores changes in the set of
built protocols. Fix that, and also improve formatting of proto-build.c
2023-02-01 17:31:18 +01:00
Toke Høiland-Jørgensen
dc4c5f51f8 Babel: Initialise source seqno from incoming message
When creating a new babel_source object we initialise the seqno to 0. The
caller will update the source object with the right metric and seqno value,
for both newly created and old source objects. However if we initialise the
source object seqno to 0 that may actually turn out to be a valid (higher)
seqno than the one in the routing table, because of seqno wrapping. In this
case the source metric will not be set properly, which breaks feasibility
tracking for subsequent updates.

To fix this, add a new initial_seqno argument to babel_get_source() which
is used when allocating a new object, and set that to the seqno value of
the update we're sending.

Thanks to Juliusz Chroboczek for the bugreport.
2023-01-31 15:52:14 +01:00
Ondrej Zajicek
96d7c4679d Babel: Improve clarity of unfeasible update handling.
Add a comment and (unnecessary) check to make correctness obvious.
2023-01-30 23:49:20 +01:00
Toke Høiland-Jørgensen
3e7e4a7186 Babel: Fix missing modulo comparison of seqnos
Juliusz noticed there were a couple of places we were doing straight
inequality comparisons of seqnos in Babel. This is wrong because seqnos can
wrap: so we need to use the modulo-64k comparison function for these cases
as well.

Introduce a strict-inequality version of the modulo-comparison for this
purpose.
2023-01-30 23:36:39 +01:00
Maria Matejka
05d8c3699d Object locks use events
Instead of calling custom hooks from object locks, we use standard event
sending mechanism to inform protocols about object lock changes. This is
a backport from version 3 where these events are passed across threads.

This implementation of object locks doesn't use mutexes to lock the
whole data structure. In version 3, this data structure may get accessed
from multiple threads and must be protected by mutex.
2023-01-26 13:22:28 +01:00
Maria Matejka
4334f86251 VRF setting reduced to one argument, using default dummy iface for default vrf 2023-01-25 13:33:31 +01:00
Maria Matejka
f7c2a886c9 Object locks use events
Instead of calling custom hooks from object locks, we use standard event
sending mechanism to inform protocols about object lock changes. As
event sending is lockless, the unlocking protocol simply enqueues the
appropriate event to the given loop when the locking is done.
2023-01-24 11:34:36 +01:00
Maria Matejka
3ac628e0f0 Merge v2.0.12 into thread-next 2023-01-24 11:04:28 +01:00
Maria Matejka
02b2a4ecaa Merge commit '3186ffe79714a48542d5ad61a94c81216b522fd0' into thread-next 2023-01-24 09:45:40 +01:00
Maria Matejka
3d96a16ae8 Merge commit '6bb992cb04926895be57dc97e7d569ea15a07db1' into thread-next 2023-01-24 09:44:43 +01:00
Maria Matejka
717612fa18 Merge commit '9dc9124c' into thread-next 2023-01-24 09:21:34 +01:00
Maria Matejka
9dc9124cec Revert "Filter: Allow setting the 'onlink' route attribute in filters"
This reverts commit 7144c9ca46.

The onlink attribute implementation collides with the nexthop attribute
behavior in v3; keeping it aside until finding out how to reimplement it
correctly.
2023-01-24 09:20:36 +01:00
Maria Matejka
21b772fd43 Merge commit '928a1cb034e6f9e8edcdd1dc07264cd703e00827' into thread-next 2023-01-23 19:51:24 +01:00
Maria Matejka
758aabd96c Merge commit '7fb23041a52d01754c53ba963e2282e524813364' into thread-next 2023-01-23 19:46:26 +01:00
Maria Matejka
4821612c94 Merge commit 'd1cd5e5a63b2256eb71661f7438537e4ded7b01a' into thread-next 2023-01-23 19:42:12 +01:00
Maria Matejka
4e6cd1b2e3 Merge commit 'b28431e557c4f63923476094a919a0630001275e' into thread-next 2023-01-23 19:39:45 +01:00
Maria Matejka
5481bcd82f Merge commit 'd3f50ede127df338f575e188566035b2a46cf6c6' into thread-next 2023-01-23 19:05:41 +01:00
Maria Matejka
7bb93efc27 Merge commit '6d1ae197d189d50e60279796441c6e74272ddc54' into thread-next 2023-01-23 19:03:16 +01:00
Maria Matejka
5aeaa0c2ca Merge commit '8b06a4d8af46511f0f8dbb8905afa88590a831b6' into thread-next 2023-01-23 18:57:13 +01:00
Alexander Zubkov
72230d3ca3 Small fix of indenting 2023-01-23 14:23:00 +01:00
Ondrej Zajicek
5437104afa NEWS and version update 2023-01-23 02:23:19 +01:00
Ondrej Zajicek
99872676df BFD: Improve incoming packet matching
For active sessions, ignore received packets with zero local id and
mismatched remote id. That forces a session timeout instead of an
immediate session restart. It makes BFD sessions more resilient to
packet spoofing.

Thanks to André Grüneberg for the suggestion.
2023-01-22 23:42:08 +01:00
Ondrej Zajicek
a82683694d VRF: Fix issues with reconfiguration
Protocols receive if_notify() announcements that are filtered according
to their VRF setting, but during reconfiguration, they access iface_list
directly and forgot to check VRF setting here, which leads to all
interfaces be addedd.

Fix this issue for Babel, OSPF, RAdv and RIP protocols.

Thanks to Marcel Menzel for the bugreport.
2023-01-22 18:21:08 +01:00
Maria Matejka
521fec2fdc Merge commit '2b7643e1f8ecb0bd4cf9af4183b4fd53b655d19c' into thread-next 2023-01-22 13:19:22 +01:00
Maria Matejka
3186ffe797 Added test case for switch bug fixed in e20bef69cc 2023-01-22 12:55:31 +01:00
Maria Matejka
21c4c8eafb Merge commit '1e47b9f203aaaad0fb658d40a1670f1d0437f1f8' into thread-next 2023-01-21 23:49:52 +01:00
Maria Matejka
2f764c87ff Merge commit 'e48f898fdaf06b61754ae520410729a9984ab65b' into thread-next 2023-01-21 23:46:45 +01:00
Maria Matejka
0f9df6d1bd Merge commit 'a80cd4707464cedb526eb72e7704b097af20beb7' into thread-next 2023-01-21 23:46:33 +01:00
Maria Matejka
985c060342 Merge commit '3859e4efc1597368df647323c5a3cc1771cb64ca' into thread-next 2023-01-21 23:45:13 +01:00
Maria Matejka
4500749ce6 Merge commit 'e80156d9363a594ff23524f56d59f0eee160859d' into thread-next 2023-01-21 23:45:04 +01:00
Maria Matejka
7a262bc999 Adding forgotten pthread.h #include in io-loop.h (breaks at openbsd 7.1) 2023-01-21 23:42:02 +01:00
Maria Matejka
61f9b78c24 Merge commit 'a50d2fa65f3350ee55f5106b87a884d1b98e7761' into thread-next 2023-01-21 22:57:12 +01:00
Maria Matejka
cca385707f Merge commit '543c8ba0971e91da3fe507dbfc1e1f9b556642b1' into thread-next 2023-01-21 22:32:29 +01:00
Maria Matejka
343628d8c0 Fixed various build problems on FreeBSD and/or CLang 2023-01-20 18:31:57 +01:00
Ondrej Zajicek
af611f93aa BGP: Add received role value to role mismatch log message 2023-01-20 15:55:47 +01:00
Maria Matejka
1127f19a7a Merge commit '140c534fb81d0e165b7d674e869c646455ed19d1' into thread-next 2023-01-19 18:17:05 +01:00
Maria Matejka
84c298465f Decoupling loops from threads to allow fixed thread count
On large configurations, too many threads would spawn with one thread
per loop. Therefore, threads may now run multiple loops at once. The
thread count is configurable and may be changed during run. All threads
are spawned on startup.

This change helps with memory bloating. BIRD filters need large
temporary memory blocks to store their stack and also memory management
keeps its hot page storage per-thread.

Known bugs:
* Thread autobalancing is not yet implemented.
* Low latency loops are executed together with standard loops.
2023-01-19 11:13:50 +01:00