Commit graph

229 commits

Author SHA1 Message Date
Maria Matejka
b2a4feeb4c Merge branch 'master' into mq-filter-stack 2019-07-10 11:27:08 +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
Maria Matejka
4c553c5a5b Filter refactoring: dropped the recursion from the interpreter
This is a major change of how the filters are interpreted. If everything
works how it should, it should not affect you unless you are hacking the
filters themselves.

Anyway, this change should make a huge improvement in the filter performance
as previous benchmarks showed that our major problem lies in the
recursion itself.

There are also some changes in nest and protocols, related mostly to
spreading const declarations throughout the whole BIRD and also to
refactored dynamic attribute definitions. The need of these came up
during the whole work and it is too difficult to split out these
not-so-related changes.
2019-02-20 22:30:54 +01:00
Arthur Gautier
4659b2ae45 KRT: Fix debug messages in netlink code 2018-12-28 19:41:18 +01:00
Ondrej Zajicek (work)
586c1800c4 Nest: Neighbor cache cleanups
Simplify neighbor cache code, fix several minor bugs, and improve
handling of ONLINK flag.
2018-06-27 16:57:07 +02:00
Jan Maria Matejka
f851f0d7e3 Config: Dropping CF_ADDTO. 2018-06-26 14:29:03 +02:00
Jan Maria Matejka
13c0be19d3 Nest: Removing separate tmpa from route propagation
This is a fundamental change of an original (1999) concept of route
processing inside BIRD. During import/export, there was a temporary
ea_list created which was to be used instead of the another one inside
the route itself.

This led to some confusion, quirks, and strange filter code that handled
extended route attributes. Dropping it now.

The protocol interface has changed in an uniform way -- the
`struct ea_list *attrs` argument has been removed from store_tmp_attrs(),
import_control(), rt_notify() and get_route_info().
2018-05-30 17:08:49 +02:00
Jan Maria Matejka
ee7e2ffd26 Protocol: Introducing an enum protocol_class
This supersedes the EAP_* constants.
2018-05-29 12:35:06 +02:00
Ondrej Zajicek (work)
be17805c0b Add support for source-specific IPv6 routes to BIRD core
This patch adds support for source-specific IPv6 routes to BIRD core.
This is based on Dean Luga's original patch, with the review comments
addressed. SADR support is added to network address parsing in confbase.Y
and to the kernel protocol on Linux.

Currently there is no way to mix source-specific and non-source-specific
routes (i.e., SADR tables cannot be connected to non-SADR tables).

Thanks to Toke Hoiland-Jorgensen for the original patch.
Minor changes by Ondrej Santiago Zajicek.
2018-02-13 16:39:07 +01:00
Ondrej Zajicek (work)
3013fc57bd Netlink: Fix memory leak 2017-12-16 00:42:56 +01:00
Ondrej Zajicek (work)
3e7923507b Netlink: Use linpool instead of static buffer 2017-12-13 15:27:33 +01:00
Ondrej Zajicek (work)
66acbc8d7f Revive FIB and kernel MPLS code 2017-12-12 00:05:49 +01:00
Ondrej Zajicek (work)
c99050cce2 KRT: Fix bug in multipath handling 2017-12-11 01:04:15 +01:00
Maria Jan Matejka
6b0f5f68a8 Switchoff for MPLS in kernel. 2017-12-10 18:30:00 +01:00
Ondrej Zajicek (work)
517d05dff1 Enable ECMP and Link detection by default
ECMP is not enabled on BSD, where it is not supported by BIRD.
2017-12-08 16:00:33 +01:00
Ondrej Zajicek (work)
46434a3cad Merge commit '7b2c5f3d2826e3175bf31b1c36056c9efc587a2b' into int-new 2017-12-07 18:35:46 +01:00
Ondrej Zajicek (work)
4ff15a75c5 Merge commit '98bb80a243b58c43453e9be69d19d0350286549c' into int-new 2017-12-07 17:41:09 +01:00
Ondrej Zajicek (work)
a6f79ca57f Timers: Revert temporary names and remove old timer.h 2017-12-07 13:54:59 +01:00
Ondrej Zajicek (work)
574b232427 Timers: Fix TBF and some last remains 2017-12-07 13:53:42 +01:00
Ondrej Zajicek (work)
153f02da3b Nest: Maintain separate IPv4, IPv6 and LLv6 preferred addresses
Also redesign preferred address selection and update protocols to use
appropriate preferred address.

Based on a previous work by Jan Maria Matejka.
2017-12-07 13:06:01 +01:00
Ondrej Zajicek (work)
943478b00f Basic VRF support
Add basic VRF (virtual routing and forwarding) support. Protocols can be
associated with VRFs, such protocols will be restricted to interfaces
assigned to the VRF (as reported by Linux kernel) and will use sockets
bound to the VRF. E.g., different multihop BGP instances can use diffent
kernel routing tables to handle BGP TCP connections.

The VRF support is preliminary, currently there are several limitations:

- Recent Linux kernels (4.11) do not handle correctly sockets bound
to interaces that are part of VRF, so most protocols other than multihop
BGP do not work. This will be fixed by future kernel versions.

- Neighbor cache ignores VRFs. Breaks config with the same prefix on
local interfaces in different VRFs. Not much problem as single hop
protocols do not work anyways.

- Olock code ignores VRFs. Breaks config with multiple BGP peers with the
same IP address in different VRFs.

- Incoming BGP connections are not dispatched according to VRFs.
Breaks config with multiple BGP peers with the same IP address in
different VRFs. Perhaps we would need some kernel API to read VRF of
incoming connection? Or probably use multiple listening sockets in
int-new branch.

- We should handle master VRF interface up/down events and perhaps
disable associated protocols when VRF goes down. Or at least disable
associated interfaces.

- Also we should check if the master iface is really VRF iface and
not some other kind of master iface.

- BFD session request dispatch should be aware of VRFs.

- Perhaps kernel protocol should read default kernel table ID from VRF
iface so it is not necessary to configure it.

- Perhaps we should have per-VRF default table.
2017-09-06 17:38:48 +02:00
Ondrej Zajicek (work)
98bb80a243 KRT: Fix IPv6 ECMP handling with Linux 4.11+
Starting from Linux 4.11, IPv6 ECMP routes are now notified using
RTA_MULTIPATH, like IPv4 ones. The patch adds support for RTA_MULTIPATH
parsing for IPv6 routes. This also enables to parse ECMP alien routes
correctly.

Thanks to Vincent Bernat for the original patch.
2017-09-05 00:02:20 +02:00
Ondrej Zajicek (work)
a1f5e514ef Implement onlink flag for nexthops
Add proper support for per-nexthop onlink flag in routes to handle next
hop addresses that are not covered by interface IP ranges. Supported by
kernel and static protocols.

Thanks to Vincent Bernat for the idea.
2017-07-04 23:36:21 +02:00
Ondrej Zajicek (work)
734e9fb8a9 Minor cleanups and fixes 2017-05-23 13:12:25 +02:00
Ondrej Zajicek (work)
d19617f06b Merge remote-tracking branch 'origin/int-new' into int-new 2017-05-17 14:50:00 +02:00
Jan Moskyto Matejka
05d47bd53e Linpool: default allocation size 2017-05-16 15:34:57 +02:00
Ondrej Zajicek (work)
c253ec3a9c Some more autoconf cleanups
Replace integer type width detection with C99 fixed-width types.
Also remove some unused or obsolete code.

Thanks to Ruben Kerkhof for the patchset.
2017-05-16 12:59:22 +02:00
Ondrej Zajicek (work)
525a88d879 Merge branch 'master' into int-new 2017-05-09 14:48:21 +02:00
Ondrej Zajicek (work)
5d6dc93043 Some more autoconf cleanups
Replace integer type width detection with C99 fixed-width types.
Also remove some unused or obsolete code.

Thanks to Ruben Kerkhof for the patchset.
2017-05-09 13:45:26 +02:00
Jan Moskyto Matejka
97e48b6a18 Adding also our copy of struct rtvia. 2017-04-12 16:04:22 +02:00
Jan Moskyto Matejka
54635f435a Include local lwtunnel.h unless found in system 2017-04-12 16:04:22 +02:00
Ondrej Zajicek (work)
bff21441dd Netlink: Change default kernel metric to 32
This avoids collisions with non-BIRD routes in kernel tables.
2017-03-29 16:10:00 +02:00
Ondrej Zajicek (work)
ed6100441e Netlink: Better handling of an error case 2017-03-29 15:55:39 +02:00
Ondrej Zajicek (work)
7074be22f1 Netlink: Fix device route delete 2017-03-28 18:27:08 +02:00
Ondrej Zajicek (work)
d1b8fe93f0 Netlink: Fix bug in RTA_PRIORITY handling 2017-03-28 16:05:40 +02:00
Jan Moskyto Matejka
c609d03986 Merge branch 'int-new' into nexthop-merged 2017-02-22 11:58:04 +01:00
Ondrej Zajicek (work)
62e64905b7 Several minor fixes 2017-02-20 02:26:45 +01:00
Ondrej Zajicek (work)
c259669fa3 Merge branch 'master' into int-new 2017-02-08 14:34:48 +01:00
Jan Moskyto Matejka
d14f8c3c45 Netlink: MPLS routes in kernel
Anyway, Bird is now capable to insert both MPLS routes and MPLS encap
routes into kernel.

It was (among others) needed to define platform-specific AF_MPLS to 28
as this constant has been assigned in the linux kernel.

No support for BSD now, it may be added in the future.
2016-12-22 21:38:33 +01:00
Jan Moskyto Matejka
5b208e296f Removing (struct rta)->cast. Never used. 2016-12-22 13:09:59 +01:00
Jan Moskyto Matejka
4e276a8920 Merged multipath and single-path data structures.
Dropped struct mpnh and mpnh_*()
Now struct nexthop exists, nexthop_*(), and also included struct nexthop
into struct rta.

Also converted RTD_DEVICE and RTD_ROUTER to RTD_UNICAST. If it is needed
to distinguish between these two cases, RTD_DEVICE is equivalent to
IPA_ZERO(a->nh.gw), RTD_ROUTER is then IPA_NONZERO(a->nh.gw).

From now on, we also explicitely want C99 compatible compiler. We assume
that this 20-year norm should be known almost everywhere.
2016-12-22 13:01:06 +01:00
Jan Moskyto Matejka
2c33da5070 Netlink: fix occasional netlink hangs on busy machines 2016-12-20 20:36:56 +01:00
Ondrej Zajicek (work)
9b0a0ba9e6 Unit Testing for BIRD
- Unit Testing Framework (BirdTest)
 - Integration of BirdTest into the BIRD build system
 - Tests for several BIRD modules

 Based on squashed Pavel Tvrdik's int-test branch, updated for
 current int-new branch.
2016-11-09 16:36:34 +01:00
Ondrej Zajicek (work)
8860e991f6 Merge branch 'master' into int-new 2016-11-08 19:27:58 +01:00
Ondrej Zajicek (work)
c8cafc8ebb Minor code cleanups 2016-11-08 17:46:29 +01:00
Ondrej Zajicek (work)
cc5b93f72d Merge tag 'v1.6.2' into int-new 2016-11-08 17:04:29 +01:00
Jan Moskyto Matejka
3e236955c9 Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on older
versions of GCC than 5.1, all of them false positive.
2016-11-01 14:52:54 +01:00
Jan Moskyto Matejka
ccd2a3eda2 Kernel socket missing err_hook fix
Thanks to Tim Weippert for bugreport.
2016-09-29 13:21:16 +02:00