0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-20 12:25:20 +00:00
Commit Graph

4277 Commits

Author SHA1 Message Date
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
Maria Matejka
521fec2fdc Merge commit '2b7643e1f8ecb0bd4cf9af4183b4fd53b655d19c' into thread-next 2023-01-22 13:19:22 +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
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
Maria Matejka
4d8d81f144 Table prune routine doesn't walk over lists unless needed.
If no channel is flushing, table prune doesn't walk over routes in nets
and also doesn't walk over importing channel lists. This helps to
alleviate the memory caching burdens a lot.
2023-01-19 11:10:25 +01:00
Maria Matejka
59a5bf18f9 CLI closing fix when its action is run asynchronously.
Some CLI actions, notably "show route", are run by queuing an event
somewhere else. If the user closes the socket, in case such an action is
being executed, the CLI must free the socket immediately from the error
hook but the pool must remain until the asynchronous event finishes and
cleans everything up.
2023-01-19 11:03:31 +01:00
Maria Matejka
34aeafbf9e Removed config reparsing from unrelated tests 2023-01-19 11:00:38 +01:00
Ondrej Zajicek
d1cd5e5a63 BGP: Allow role specific keywords to be used as symbols
Some of these new BGP role keywords use generic names that collides with
user-defined symbols. Allow them to be redefined. Also remove duplicit
keyword definition for 'prefer'.
2023-01-03 19:11:34 +01:00
Ondrej Zajicek
309c874f9c Configure: Expensive check option was broken, never worked 2023-01-03 17:14:48 +01:00
Ondrej Zajicek
b28431e557 Nest: Fix leaking internal attributes in RIP and Babel
During backporting attribute changes from 3.0-branch, some internal
attributes (RIP iface and Babel seqno) leaked to 'show route all' output.
Allow protocols to hide specific attributes with GA_HIDDEN value.

Thanks to Nigel Kukard for the bugreport.
2023-01-03 17:01:54 +01:00
Ondrej Zajicek
d3f50ede12 Add compile-time option to enable 4-way tries instead of 16-way ones
In some cases 16-way tries are too memory-heavy, while 4-way are
almost as efficient as the original 2-way ones.
2023-01-02 15:55:55 +01:00
Ondrej Zajicek
6d1ae197d1 Nest: Fix several issues with pflags
There were some confusion about validity and usage of pflags, which
caused incorrect usage after some flags from (now removed) protocol-
specific area were moved to pflags.

We state that pflags:

 - Are secondary data used by protocol-specific hooks
 - Can be changed on an existing route (in contrast to copy-on-write
   for primary data)
 - Are irrelevant for propagation (not propagated when changed)
 - Are specific to a routing table (not propagated by pipe)

The patch did these fixes:

 - Do not compare pflags in rte_same(), as they may keep cached values
   like BGP_REF_STALE, causing spurious propagation.

 - Initialize pflags to zero in rte_get_temp(), avoid initialization in
   protocol code, fixing at least two forgotten initializations (krt
   and one case in babel).

 - Improve documentation about pflags
2023-01-01 20:10:23 +01:00
Toke Høiland-Jørgensen
8b06a4d8af Babel: Rework seqno request handling
The seqno request retransmission handling was tracking the destination
that a forwarded request was being sent to and always retransmitting to
that same destination. This is unnecessary because we only need to
retransmit requests we originate ourselves, not those we forward on
behalf of others; in fact retransmitting on behalf of others can lead to
exponential multiplication of requests, which would be bad.

So rework the seqno request tracking so that instead of storing the
destination of a request, we just track whether it was a request that we
forwarded on behalf of another node, or if it was a request we originated
ourselves. Forwarded requests are not retransmitted, they are only used
for duplicate suppression, and for triggering an update when satisfied.
If we end up originating a request that we previously forwarded, we
"upgrade" the old request and restart the retransmit counter.

One complication with this is that requests sent in response to unfeasible
updates (section 3.8.2.2 of the RFC) have to be sent as unicast to a
particular peer. However, we don't really need to retransmit those as
there's no starvation when sending such a request; so we just change
such requests to be one-off unicast requests that are not subject to
retransmission or duplicate suppression. This is the same behaviour as
babeld has for such requests.

Minor changes from committer.
2022-12-24 15:52:12 +01:00
Ondrej Zajicek
2b7643e1f8 BSD: Use ip_mreqn on FreeBSD 12.1+ and OpenBSD 6.9+ 2022-12-18 20:23:46 +01:00
Alexander Chernikov
6825f94570 FreeBSD: use interface index instead of IP address when specifying multicast interface
Minor changes from committer.
2022-12-16 19:37:26 +01:00
Alexander Chernikov
176fc68aed Netlink: move OS-specific headers and defines to sysdep
Minor changes from committer.
2022-12-16 19:21:51 +01:00
Ondrej Zajicek
7b6c964977 BSD: Add missing makefile for bsd-netlink target
Use symlinks to linux/netlink* to avoid limitations of our buildsystem.
2022-12-16 19:03:41 +01:00
Ondrej Zajicek
1e47b9f203 NEWS and version update 2022-12-11 17:28:14 +01:00
Ondrej Zajicek
34ebc4e1ba BSD: Workaround for direct routes on FreeBSD 13.0
FreeBSD 13.0 added some safechecks for syscalls, rejecting sockaddrs that
are too small, later versions loosen up the check.
2022-12-11 16:28:28 +01:00
Ondrej Zajicek
937ebf2536 BGP: Log unacceptable hold time as decimal number
Thanks Johannes Moos for the suggestion.
2022-12-10 18:06:52 +01:00
Ondrej Zajicek
4c19a8a984 CLI: Fix for long-lived sessions during high loads
When there is a continuos stream of CLI commands, cli_get_command()
always returns 1 (there is a new command). Anyway, the socket receive
buffer was reset only when there was no command at all, leading to a
strange behavior: after a while, the CLI receive buffer came to its end,
then read() was called with zero size buffer, it returned 0 which was
interpreted as EOF.

The patch fixes that by resetting the buffer position after each command
and moving remaining data at the beginning of buffer.

Thanks to Maria Matejka for examining the bug and for the original bugfix.
2022-12-10 17:32:42 +01:00
Ondrej Zajicek
1124f39f73 Client: Unknown command should return nonzero errorcode 2022-12-10 03:02:26 +01:00
Ondrej Zajicek
e48f898fda Doc: Document issue with import tables
The import table does not work reliably together with re-evaluation of
routes due to recursive next hops or flowspec validation. We will at
least document that here, as import tables are completely redesigned and
this issue is fixed in BIRD 3.x branch.
2022-12-09 22:43:27 +01:00
Alexander V. Chernikov
a80cd47074 Netlink on FreeBSD support
Netlink support was added to FreeBSD recently. It is not as full-featured
as its Linux counterpart yet, however the added subset is enough to make
a routing daemon work. Specifically, it supports multiple tables,
multipath, nexthops and nexthops groups. No MPLS support yet.

The attached change adds 'bsd-netlink’ sysconf target, allowing to build
both netlink & rtsock versions on FreeBSD.
2022-12-09 16:01:30 +01:00
Ondrej Zajicek
3859e4efc1 BGP: Improve handling of hold and keepalive timers
The effective keepalive time now scales relative to the negotiated
hold time, to maintain proportion between the keepalive time and the
hold time. This avoids issues when both keepalive and hold times
were configured, the hold time was negotiated to a smaller value,
but the keepalive time stayed the same.

Add new options 'min hold time' and 'min keepalive time', which reject
session attempts with too small hold time.

Improve validation of config options an their documentation.

Thanks to Alexander Zubkov and Sergei Goriunov for suggestions.
2022-12-09 05:53:24 +01:00
Ondrej Zajicek
e80156d936 Nest: Avoid spurious announcements triggered by filtered routes
When filtered routes (enabled by 'import keep filtered' option) are
updated, they trigger announcements by rte_announce(). For regular
channels (e.g. type RA_OPTIMAL or RA_ANY) such announcement is just
ignored, but in case of RA_ACCEPTED (BGP peer with 'secondary' option)
it just reannounces the old (and still valid) best route.

The patch ensures that such no-change is ignored even for these channels.
2022-12-06 19:51:50 +01:00
Ondrej Zajicek
a50d2fa65f CI: Remove docker rebuild phase
It is unnnecessary and takes too much time
2022-11-30 02:48:59 +01:00
Ondrej Zajicek
ff38ee5986 CI: Try new workers 2022-11-30 02:48:59 +01:00
Ondrej Zajicek
543c8ba097 BSD: Fix krt socket code w.r.t. rte/rta changes 2022-11-30 02:43:39 +01:00
Ondrej Zajicek
140c534fb8 Fix build variables for OpenBSD 2022-11-29 18:29:30 +01:00
Ondrej Zajicek
bbac9ca958 Conf: Make 'configure check' command restricted
While it does not directly change BIRD state, it can trigger reading
arbitrary files and eating significant memory.
2022-11-09 22:02:46 +01:00
Ondrej Zajicek
371eb49043 Conf: Free stored old config before parsing new one
BIRD keeps a previous (old) configuration for the purpose of undo. The
existing code frees it after a new configuration is successfully parsed
during reconfiguration. That causes memory usage spikes as there are
temporarily three configurations (old, current, and new). The patch
changes it to free the old one before parsing the new one (as user
already requested a new config). The disadvantage is that undo is
not available after failed reconfiguration.
2022-11-09 21:54:45 +01:00
Maria Matejka
84545a26cc Added more netlab tests for automatic run.
This commit uses bird-tools in version
f35e8bce829f4bff61ec7eb07ec9c67aa867bc9a
2022-11-08 11:19:12 +01:00
Maria Matejka
47e4e97db4 Merge remote-tracking branch 'origin/master' into thread-next 2022-11-07 16:52:27 +01:00
Maria Matejka
7bbd0b5a3b Merge commit '37b64441' into thread-next 2022-11-07 10:28:01 +01:00
Maria Matejka
40bae8e1b7 Merge commit '32425297' into thread-next 2022-11-07 10:25:52 +01:00
Maria Matejka
54179a1ab3 Merge commit '8f79e6b9' into thread-next 2022-11-07 10:24:56 +01:00