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

287 Commits

Author SHA1 Message Date
Maria Matejka
8f3942a97e Route export: rejected by filter bitmap
If a route has been rejected by filter, store that information
to avoid repeated export filter runs on rejected routes.
2021-11-09 19:20:41 +01:00
Maria Matejka
c56752e436 Protocol stats split to import and export 2021-11-09 19:20:41 +01:00
Maria Matejka
56c8f2f03a Nest: Route generations and explicit tracking route propagion through pipes 2021-11-09 19:20:41 +01:00
Maria Matejka
1c2f66f2bd Refeed is done from export table when appropriate 2021-11-09 19:20:41 +01:00
Maria Matejka
575da88f7a Recursive route nexthop updates now announced with valid new_best/old_best information 2021-11-09 19:20:41 +01:00
Maria Matejka
69d1ffde4c Split route data structure to storage (ro) / manipulation (rw) structures.
Routes are now allocated only when they are just to be inserted to the
table. Updating a route needs a locally allocated route structure.
Ownership of the attributes is also now not transfered from protocols to
tables and vice versa but just borrowed which should be easier to handle
in a multithreaded environment.
2021-11-09 19:20:41 +01:00
Maria Matejka
60880b539b Extended route trace: logging Path Identifiers 2021-11-09 17:42:36 +01:00
Maria Matejka
0b295d695a Dropping the unused rte_same hook 2021-10-13 19:09:05 +02:00
Maria Matejka
89ff49f8f0 Dropping rte-local dumper entries 2021-10-13 19:09:05 +02:00
Maria Matejka
541881bedf RIP fixup + dropping the tmp_attrs mechanism as obsolete 2021-10-13 19:09:04 +02:00
Maria Matejka
3660f19dd5 Dropping the RTS_DUMMY temporary route storage.
Kernel route sync is done by other ways now and this code is not used
currently.
2021-10-13 19:09:04 +02:00
Maria Matejka
d471d5fc7c IGP metric getter refactoring to protocol callback
Direct protocol hooks for IGP metric inside nest/rt-table.c make the
protocol API unnecessarily complex. Instead, we use a proper callback.
2021-10-13 19:09:04 +02:00
Maria Matejka
5cff1d5f02 Route: moved rte_src pointer from rta to rte
It is an auxiliary key in the routing table, not a route attribute.
2021-10-13 19:09:04 +02:00
Maria Matejka
eb937358c0 Preference moved to RTA and set explicitly in protocols 2021-10-13 19:09:04 +02:00
Maria Matejka
d5a32563df Preexport: No route modification, no linpool needed 2021-10-13 19:09:04 +02:00
Maria Matejka
cee0cd148c Export table: Delay freeing of old stored route.
This is needed to provide the protocols the full old route after filters
when export table is enabled.
2021-10-13 19:09:04 +02:00
Maria Matejka
3d90241f62 Internal route tables have a reduced cleanup routine
This fixes an internal table cleanup bug introduced
in ff397df7ed.
2021-04-19 15:14:55 +02:00
Maria Matejka
ff397df7ed Routing table is now a resource allocated from its own pool
This also fixes memory leaks from import/export tables being never
cleaned up and freed.
2021-03-30 21:56:08 +02:00
Maria Matejka
4635314cef Routing tables list iteration should use explicit node struct position 2021-03-30 21:56:08 +02:00
Ondrej Zajicek (work)
00b85905b9 Nest: Automatic channel reloads based on RPKI changes
If there are roa_check() calls in channel filters, then the channel
subscribes to ROA table notifications, which are sent when ROA tables
are updated (subject to settle time) and trigger channel reload or
refeed.
2021-02-10 03:09:57 +01:00
James Lu
455c13dc99 Nest: Read Babel metric as IGP metric
(Minor syntactic changes by committer)
2020-12-29 02:25:21 +01:00
Ondrej Zajicek (work)
61dae32b29 Nest: Per-channel debug flags
The patch add support for per-channel debug flags, currently just
'states', 'routes', and 'filters'. Flag 'states' is used for channel
state changes, remaining two for routes passed through the channel.
The per-protocol debug flags 'routes'/'filters' still enable reporting
of routes for all channels, to keep existing behavior.

The patch causes minor changes in some log messages.
2020-12-07 22:19:40 +01:00
Ondrej Zajicek (work)
b962967e20 Nest: Fix crash in receive limit handling in import table
Logging as a result of triggered receive limit in import table code
accesset rte->net, which was not filed yet.

Thanks to Pier Carlo Chiodi for the bugreport.
2020-11-15 16:01:19 +01:00
Ondrej Zajicek (work)
c0e1f534c9 Nest: Keep route ordering during route updates
Put new non-best routes to the end of list instead of the second
position. Put updated routes to their old position. Position is changed
just by best route selection.
2020-07-16 15:02:10 +02:00
Maria Matejka
3bb10b4d31 Uninitialized list nodes fixes 2020-05-01 15:19:12 +02:00
Ondrej Zajicek (work)
2755002890 Filter: Optimize IPv4 prefix sets
Use separate IPv4 and IPv6 implementation of prefix sets. Just this
change makes IPv4 prefix sets 60% smaller and 50% faster.
2020-03-26 03:57:48 +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)
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 (work)
08c4c9a30b Nest: Fix bug in export table
For regular channels do not compare src in export table, as we want to
keep here only the best (exported) route per network.
2019-11-03 20:25:42 +01:00
Ondrej Zajicek (work)
843b10c8b0 Nest: Handle non-MPLS on MPLS case in recursive route update
When non-MPLS recursive route resolves to MPLS underlying route,
then it should get MPLS labels from the the underlying route.
2019-10-10 15:25:36 +02:00
Ondrej Zajicek (work)
9eace84342 Nest: Handle PtP links in recursive route update
Underlying (IGP) route may lead to PtP link, in this case it does not
need gateway. Which is different than direct route without gateway.

When recursive (BGP) route uses PtP route, it should not use recursive
next hop as immediate next hop, while for direct routes it should.
2019-10-10 15:06:32 +02:00
Ondrej Zajicek (work)
cb2b6e0494 Nest: Fix recursive route update
Missing cleanup can lead to dangling pointer to old next hops.
2019-10-10 14:01:16 +02:00
Ondrej Zajicek (work)
09ee846d92 BGP: AIGP metric support (RFC 7311) 2019-10-09 17:53:23 +02:00
Ondrej Zajicek (work)
ca2dacfcee Nest: Fix bug in export table
Exported route may be in modified state, we need to get cached one for
rte_same() and rta_clone() to work properly.
2019-09-24 17:17:37 +02:00
Maria Matejka
32a254050d Channel refeed with import table splitting between routes for one prefix 2019-08-27 19:14:15 +02:00
Ondrej Zajicek (work)
b7d7599ce3 BGP: implement Adj-RIB-Out
The patch implements optional internal export table to a channel and
hooks it to BGP so it can be used as Adj-RIB-Out. When enabled, all
exported (post-filtered) routes are stored there. An export table can be
examined using e.g. 'show route export table bgp1.ipv4'.
2019-08-14 06:02:33 +02:00
Maria Matejka
7078aa63ae Fixed one warning and one undefined value. 2019-03-22 21:40:35 +01:00
Maria Matejka
8d65add626 Merge branch 'master' into HEAD 2019-03-18 12:54:40 +01:00
Ondrej Zajicek (work)
875cc073b0 Nest: Update handling of temporary attributes
The temporary atttributes are no longer removed by ea_do_prune(), but
they are undefined by store_tmp_attrs() protocol hooks. This fixes
several bugs where temporary attributes were removed when they should
not or not removed when they should be. The flag EAF_TEMP is no longer
needed and was removed.

Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use
helper functions and to handle unset attributes properly.

Also fix some related bugs like improper handling of empty eattr list.
2019-03-14 17:31:40 +01:00
Ondrej Zajicek (work)
9aa77fcceb OSPF: Improved handling of tmpattrs
Keep track of whether OSPF tmpattrs are actually defined for given route
(using flags in rte->pflags). That makes them behave more like real
eattrs so a protocol can define just a subset of them or they can be
undefined by filters.

Do not set ospf_metric2 for other than type 2 external OSPF routes and do
not set ospf_tag for non-external OSPF routes. That also fixes a bug
where internal/inter-area route propagated from one OSPF instance to
another is initiated with infinity ospf_metric2.

Thanks to Yaroslav Dronskii for the bugreport.
2019-03-06 18:28:00 +01:00
Ondrej Zajicek (work)
93af78d2d2 Nest: Do not compare rte.flags during rte_update()
Route flags are mosty internal state of rtable, they are not significant
to whether a route has changed. With the old code, all routes received as
a part of enhanced route refresh are always re-announced to other peers
due to change in REF_STALE.
2019-02-22 02:16:39 +01:00
Maria Matejka
0b39b1cbb7 Conf: Symbol implementation converted from void pointers to union
... and consted some declarations.
2019-02-20 22:30:55 +01:00
Maria Matejka
4f082dfa89 Filter: merged filter instruction constructors, counting line size on instruction construct 2019-02-20 22:30:54 +01:00
Maria Matejka
8bdb05edb2 Filters: split the large filter.h file to smaller files.
This should be revised, there are still ugly things in the filter API.
2019-02-20 22:30:54 +01:00
Ondrej Zajicek (work)
3a8ca7abbc Nest: Prevent withdraws from propagation back to source protocol (for accepted mode)
Update for one of previous patches, handles the the issue for
first-accepted mode of route propagation.
2019-02-19 16:26:09 +01:00
Ondrej Zajicek (work)
cd16538fc9 Merge remote-tracking branch 'origin/mq-opt' 2019-02-09 15:53:16 +01:00
Ondrej Zajicek (work)
6e8fb66859 Nest: Improve export counter handling
One of previous workarounds for phantom route avoidance breaks export
counters by expanding sending of spurious withdraws, which are send when
we are not sure whether we have advertised that routes in the past.
If not, then export counter is decreased, but it was not increased
before, so it overflows under zero.

The patch fixes that by sendung spurious withdraws, but not counting them
on export counter. That may lead to error in the other direction, but that
happens only as a race condition (i.e., in normal operation filters
return proper values about old route export state).
2019-02-05 19:00:43 +01:00
Ondrej Zajicek (work)
e1c275d87b Nest: Reestablish preferred counters 2019-02-02 13:28:16 +01:00
Maria Matejka
c65a9a05f9 Nest: Don't lookup net in table before filters are run.
Using dummy net instead. This should help with performance on rejected
routes.
2019-01-31 15:02:15 +01:00
Ondrej Zajicek (work)
e84c81b76f Nest: Prevent withdraws from propagation back to source protocol
The earlier fix loosen conditions for not running filters on old
route when deciding about route propagation to a protocol to avoid
issues with ghost routes in some race conditions.

Unfortunately, the fix also caused back-propagation of withdraws. For
regular updates, back-propagation is prevented in import_control hooks,
but these are not called on withdraws. For them, import_control hooks
are called on old routes instead, changing (old, NULL) notification
to (NULL, NULL), which is ignored. By not calling export processing
in some cases, the withdraw is not ignored and is back-propagated.

This patch fixes that by contract conditions so the earlier fix is not
applied to back-propagated updates.
2019-01-30 17:25:21 +01:00