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

768 Commits

Author SHA1 Message Date
Maria Matejka
6768bc568b Simple change in UDP message sending to shutup Valgrind 2020-04-30 17:38:30 +02:00
Maria Matejka
60267ddeca Garbage collector for parallel execution 2020-04-30 17:38:30 +02:00
Maria Matejka
5387208e1c Enforce support for thread local variables and POSIX threads 2020-04-30 17:38:30 +02:00
Maria Matejka
a861727d98 Split route data structure to storage (ro) / manipulation (rw) structures.
This should help a lot with keeping the route machinery and allocations
clean. This commit also changes behaviour of rte_update() with cached
rta. Newly, calling rte_update() keeps the number of rta references.
2020-04-30 17:38:30 +02:00
Maria Matejka
0c0253a3a9 Preexport: No route modification, no linpool needed 2020-04-30 16:16:35 +02:00
Maria Matejka
1967fe4fa6 Route: moved rte_src pointer from rta to rte
It is an auxiliary key in the routing table, not a route attribute.
2020-04-30 16:15:59 +02:00
Maria Matejka
52b6e35251 Route export: Common export function.
Also:
* Feeding request by net.
* Passing only net_addr in export structure.
* Cleanup of krt_replace_rte() call.
2020-04-30 16:15:59 +02:00
Maria Matejka
eb5298f3e1 Internal API change: passing all the rt_notify() data as a single structure. 2020-04-30 16:14:26 +02:00
Maria Matejka
a267d569ee KRT: Using obligatory export table when non-trivial filters are applied.
When the kernel filter is anything more sophisticated than FILTER_ACCEPT
or FILTER_REJECT, we should ensure that the old route being sent to the
kernel protocol is really what was sent there before. This fixes the old
misbehavior when an unfiltered old route was used.
2020-04-30 16:14:26 +02:00
Maria Matejka
1eae8266e0 Dropping the tmp_attrs mechanism as obsolete
There are no protocol-specific fields in rte now.
2020-04-30 16:14:26 +02:00
Maria Matejka
d4f632da07 Kernel: Convert the rte-local attributes to extended attributes and flags to pflags 2020-04-30 16:14:26 +02:00
Maria Matejka
93c5a314da Dropping the RTS_DUMMY temporary route storage.
Kernel route sync is done by other ways now and this code is not used
currently.
2020-04-30 16:14:26 +02:00
Maria Matejka
1fd32f9562 Preference moved to RTA and set explicitly in protocols 2020-04-30 16:14:26 +02:00
Maria Matejka
86dbe0980c Route import API redefinition.
Hidden rte_get_temp() into rte_update().
Split rte_update() / rte_withdraw().
2020-04-30 16:14:25 +02:00
Maria Matejka
b5899ad768 Unix socket: Path length check directly before copying the path.
This is not needed as the string is always short enough, anyway
it may be needed in future and one strlen during BIRD start is
cheap enough.
2020-04-28 16:25:14 +02:00
Maria Matejka
684caacd4f Nest: Added const to ea_show just to declare that this shouldn't really change anything 2020-04-28 16:25:14 +02:00
Maria Matejka
fd9f0c0640 Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
2020-04-09 15:37:14 +02:00
Ondrej Zajicek (work)
e2630a494e Netlink: Handle interfaces with missing broadcast addresses 2020-03-07 05:11:21 +01:00
Ondrej Zajicek (work)
757cab18d6 BGP: Support for MD5SIG together with remote range
When dynamic BGP with remote range is configured, MD5SIG needs to use
newer socket option (TCP_MD5SIG_EXT) to specify remote addres range for
listening socket.

Thanks to Adam Kułagowski for the suggestion.
2020-02-27 17:29:17 +01:00
Maria Matejka
ab089f4fb5 Conf: Better error message when reading iproute2 config
Reported by: Martin Weinelt <martin@darmstadt.freifunk.net>
2020-02-04 10:34:46 +01:00
Ondrej Zajicek (work)
7d767c5a3d KRT: Improve syncer code to avoid using temporary data in rtable
The old code stored route verdicts and temporary routes directly in
rtable. The new code do not store received routes (it immediately
compares them with exported routes and resolves conflicts) and uses
internal bitmap to keep track of which routes were received and which
needs to be reinstalled.

By not putting 'invalid' temporary routes to rtable, we keep rtable
in consistent state, therefore scan no longer needs to be atomic
operation and could be splitted to multiple events.
2020-01-07 18:35:03 +01:00
Ondrej Zajicek (work)
cc75b3e1dc KRT: Remove KRF_SYNC_ERROR flag
This info is now stored in an internal bmap. Unfortunately, net.flags
is still needed for temporary kernel data.
2019-12-19 16:34:35 +01:00
Ondrej Zajicek (work)
90a9c97e38 KRT: Fix removal of KRF_INSTALLED
Use route id from net->routes to check export_map. Route received from
sysdep KRT code does not have proper id.
2019-12-17 16:30:29 +01:00
Ondrej Zajicek (work)
c132acae36 KRT: Remove KRF_INSTALLED flag
The same information is stored in export_map of kernel protocol.
2019-12-16 02:42:24 +01:00
Ondrej Zajicek (work)
5ea39eaa96 Nest: Use bitmaps to keep track of exported routes
Use a hierarchical bitmap in a routing table to assign ids to routes, and
then use bitmaps (indexed by route id) in channels to keep track whether
routes were exported. This avoids unreliable and inefficient re-evaluation
of filters for old routes in order to determine whether they were exported.
2019-11-26 18:39:25 +01:00
Ondrej Zajicek
53401bef63 Netlink: Handle IPv4 routes with IPv6 nexthops
Accept RTA_VIA attribute in all cases. The old code always used
RTA_GATEWAY for IPv4 / IPv6 and RTA_VIA for MPLS. The new code uses
RTA_VIA in cases where AF of network and AF of nexthop differs.
2019-11-12 18:13:21 +01:00
Ondrej Zajicek
5ce881be82 Accept uppercase letters in iproute2 names
Names read from texfiles in /etc/iproute2/* are normalized by replacing
non-alphanumeric chars with underscore. The patch fixes handling of
uppercase letters, which were handled as non-alphanumberic.

Thanks to Igor Gavrilov for the bugreport.
2019-10-22 16:25:38 +02:00
Ondrej Zajicek (work)
b000a94275 NEWS and version update 2019-10-11 00:18:38 +02:00
Ondrej Zajicek (work)
759b204be3 Lib: Support for 64-bit numbers in bvsnprintf()
Use 'l' for s64/u64 instead of for long/ulong, as that is much more
useful. Also make number() correct with regard to signed/unsigned
typecasts.
2019-10-09 17:53:23 +02:00
Maria Matejka
24493e9169 Fixed undefined behavior on signals.
The C11 specification allows only sig_atomic_t and _Atomic variable
access. All other accesses to global variables are undefined behavior.

Using int was probably OK on x86 and x86_64; yet there were some reports
from other architectures (especially some MIPS) that in rare cases,
after issuing SIGHUP, BIRD did strange things.
2019-10-04 20:52:07 +02:00
Ondrej Zajicek (work)
9c79022153 Nest: Fix help for 'graceful restart' command
Multi-worded commands are not automatically added to top-level
help output.

Thanks to Christoph for the bugreport.
2019-09-23 14:52:31 +02:00
Ondrej Zajicek (work)
5235c3f78d NEWS and version update 2019-09-10 17:34:41 +02:00
Ondrej Zajicek (work)
5ab3447de1 Sysdep: Drop supplementary groups when dropping GID
We forgot to do that. Oops.
2019-08-21 17:30:00 +02:00
Ondrej Zajicek (work)
543875e080 NEWS and version update 2019-07-31 23:35:29 +02:00
Ondrej Zajicek (work)
96e4d0960c Change 'graceful down' command to 'graceful restart' and update docs
The command initiating planned graceful restart including bird shutdown
should be called 'graceful restart' instead of 'graceful down', as the
later should be reserved for graceful shutdown in style of RFC 8326.
2019-07-31 19:45:29 +02:00
Maria Matejka
48addc88be Log: Fixed race condition in reconfigure while BFD is running 2019-07-30 12:26:37 +02:00
Ondrej Zajicek (work)
cec40a7467 Merge remote-tracking branch 'origin/mq-filter-stack' 2019-07-24 15:38:32 +02:00
Ondrej Zajicek (work)
15b0a92294 RPKI: Fix reconfiguration when ssh parameters are undefined 2019-07-23 01:52:18 +02:00
Ondrej Zajicek (work)
2eaf65ec60 Netlink: Fix parsing of multipath routes with MPLS labels 2019-07-15 18:16:55 +02:00
Ondrej Zajicek (work)
8235c4747d Netlink: Use route replace for IPv4
Use route replace netlink op instead of delete+add netlink ops for kernel
IPv4 route replace. This avoids some packetloss during route replace.
Still use the old behavior for IPv6, as some kernel bugs are hidden in
IPv6 ECMP handling.
2019-07-15 16:23:18 +02:00
Maria Matejka
b2a4feeb4c Merge branch 'master' into mq-filter-stack 2019-07-10 11:27:08 +02:00
Maria Matejka
422a933429 Debug: growing message format buffer
This led in corner cases to undefined buffer content
and garbage output.
2019-07-10 11:12:41 +02:00
Maria Matejka
eac9250fd5 Merge branch 'master' into mq-filter-stack 2019-07-03 11:12:25 +02:00
Maria Matejka
78976974e7 Dynamic attributes definition split whether it is bitmask or not. 2019-07-03 00:00:11 +02:00
Ondrej Zajicek (work)
59d3a3611f Netlink: Handle alien routes with unsorted nexthops
Nest requires that nexthops are sorted, the kernel protocol have to
ensure that for alien routes.
2019-07-02 18:23:06 +02:00
Ondrej Zajicek (work)
1187627a1d Netlink: Do unified scan for both IPv4 and IPv6
Instead of separate scans for IPv4, IPv6 and MPLS, do one AF_UNSPEC scan.

This also avoids kernel issue when kernel reported IPv4 and IPv6 routes
during MPLS scan if MPLS is not active.
2019-07-02 16:30:36 +02:00
Ondrej Zajicek (work)
8a68316eb9 Nest: Add command to request graceful restart
When 'graceful down' command is entered, protocols are shut down
with regard to graceful restart. Namely Kernel protocol does
not remove routes and BGP protocol does not send notification,
just closes the connection.
2019-06-30 21:29:24 +02:00
Ondrej Zajicek (work)
9106a750cd Add CLI command to test reconfiguration status
Based on patch from Kenth Eriksson <kenth.eriksson@infinera.com>.
2019-06-12 17:15:35 +02:00
Ondrej Zajicek (work)
e0835db4f1 BGP: Dynamic BGP
Support for dynamically spawning BGP protocols for incoming connections.
Use 'neighbor range' to specify range of valid neighbor addresses, then
incoming connections from these addresses spawn new BGP instances.
2019-04-30 13:32:39 +02:00
Maria Matejka
7078aa63ae Fixed one warning and one undefined value. 2019-03-22 21:40:35 +01:00