]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
3 years agoDoc: Fix missing semicolons legacy
Ondrej Zajicek (work) [Mon, 5 Oct 2020 13:01:11 +0000 (15:01 +0200)] 
Doc: Fix missing semicolons

Thanks to Marco Gartmann for the bugreport.

3 years agoUnix: fix compilation with GCC 10
Vincent Bernat [Mon, 28 Sep 2020 14:30:56 +0000 (16:30 +0200)] 
Unix: fix compilation with GCC 10

GCC 10 will now error when declaring a global variable twice:

  https://gcc.gnu.org/gcc-10/porting_to.html#common

Fix this issue by declaring the variable as `extern' in `krt.h'.
The variable is really declared in `krt.c'.

4 years agoNEWS and version update v1.6.8
Ondrej Zajicek (work) [Tue, 10 Sep 2019 15:36:41 +0000 (17:36 +0200)] 
NEWS and version update

4 years agoSysdep: Drop supplementary groups when dropping GID
Ondrej Zajicek (work) [Tue, 10 Sep 2019 13:08:15 +0000 (15:08 +0200)] 
Sysdep: Drop supplementary groups when dropping GID

We forgot to do that. Oops.

4 years agoBGP: Fix handling of bgp_aggregator atttribute
Ondrej Zajicek (work) [Mon, 9 Sep 2019 11:32:50 +0000 (13:32 +0200)] 
BGP: Fix handling of bgp_aggregator atttribute

The attribute should not be modifiable by filters as we do not
support its type.

4 years agoBGP: Fix bugs in handling of shutdown messages
Ondrej Zajicek (work) [Mon, 9 Sep 2019 01:48:27 +0000 (03:48 +0200)] 
BGP: Fix bugs in handling of shutdown messages

There is an improper check for valid message size, which may lead to
stack overflow and buffer leaks to log when a large message is received.

Thanks to Daniel McCarney for bugreport and analysis.

4 years agoVersion 1.x.x uses "legacy" git branch. Thanks Vicent Bernat for the notification.
Ondrej Filip [Mon, 12 Aug 2019 13:01:21 +0000 (15:01 +0200)] 
Version 1.x.x uses "legacy" git branch. Thanks Vicent Bernat for the notification.

4 years agoNEWS and version update v1.6.7
Ondrej Zajicek (work) [Thu, 1 Aug 2019 01:31:23 +0000 (03:31 +0200)] 
NEWS and version update

4 years agoDoc: Update documentation about VRFs and BFD
Ondrej Zajicek (work) [Wed, 31 Jul 2019 23:02:31 +0000 (01:02 +0200)] 
Doc: Update documentation about VRFs and BFD

4 years agoNest: VRF of protocol can be explicitly specified as 'default'
Ondrej Zajicek (work) [Wed, 31 Jul 2019 22:53:22 +0000 (00:53 +0200)] 
Nest: VRF of protocol can be explicitly specified as 'default'

Protocol can have specified VRF, in such case it is restricted to a set
of ifaces associated with the VRF, otherwise it can use all interfaces.

The patch allows to specify VRF as 'default', in which case it is
restricted to a set of iface not associated with any VRF.

4 years agoLog: Fixed race condition in reconfigure while BFD is running
Maria Matejka [Tue, 30 Jul 2019 10:11:12 +0000 (12:11 +0200)] 
Log: Fixed race condition in reconfigure while BFD is running

4 years agoDebug: growing message format buffer
Maria Matejka [Wed, 10 Jul 2019 09:12:41 +0000 (11:12 +0200)] 
Debug: growing message format buffer

This led in corner cases to undefined buffer content
and garbage output.

4 years agoLib: Fix print of 64-bit router id
Ondrej Zajicek (work) [Thu, 18 Jul 2019 00:05:36 +0000 (02:05 +0200)] 
Lib: Fix print of 64-bit router id

Mismatched types to printf(). The old code coincidentally worked on amd64
due to its calling conventions.

Thanks to Maximilian Eschenbacher for the bugreport.

4 years agoBFD: Support for VRFs
Ondrej Zajicek (work) [Thu, 18 Jul 2019 00:04:42 +0000 (02:04 +0200)] 
BFD: Support for VRFs

Allow multiple BFD instances in separate VRFs, dispatch BFD requests
according to VRFs.

Thanks to Alexander Zubkov for notice and patches.

4 years agoBGP: Compliance with RFC8203bis
Alexander Azimov [Thu, 11 Jul 2019 13:44:52 +0000 (15:44 +0200)] 
BGP: Compliance with RFC8203bis

4 years agoOSPF: Update DR when local priority changes
Ondrej Zajicek (work) [Thu, 11 Jul 2019 13:39:41 +0000 (15:39 +0200)] 
OSPF: Update DR when local priority changes

When priority is reconfigured locally, we need to trigger DR election.

4 years agoAvoid fallthrough warnings
Ondrej Zajicek (work) [Thu, 11 Jul 2019 13:36:42 +0000 (15:36 +0200)] 
Avoid fallthrough warnings

4 years agoOSPF: N-bit should not be set for DBDES packets
Ondrej Zajicek (work) [Thu, 11 Jul 2019 13:31:15 +0000 (15:31 +0200)] 
OSPF: N-bit should not be set for DBDES packets

4 years agoBGP: Prefix hash is too small, increase its max size.
Maria Jan Matejka [Tue, 11 Jun 2019 13:19:21 +0000 (13:19 +0000)] 
BGP: Prefix hash is too small, increase its max size.

This doesn't make any change for you until you have
millions of updates waiting to be sent. Increasing
the max hash size from 2^20 to 2^24.

4 years agoBGP: split tx explicitly
Maria Jan Matejka [Tue, 11 Jun 2019 09:35:25 +0000 (09:35 +0000)] 
BGP: split tx explicitly

If BGP has too many data to send and BIRD is slower than the link, TX is
always possible until all data is sent. This patch limits maximum number
of generated BGP messages in one iteration of TX hook.

5 years agoSmall typo in doc.
Ondrej Filip [Wed, 24 Apr 2019 11:50:54 +0000 (13:50 +0200)] 
Small typo in doc.

5 years agoNEWS and version update v1.6.6
Ondrej Zajicek (work) [Tue, 26 Feb 2019 17:10:04 +0000 (18:10 +0100)] 
NEWS and version update

5 years agoNest: Do not compare rte.flags during rte_update()
Ondrej Zajicek (work) [Fri, 22 Feb 2019 01:33:01 +0000 (02:33 +0100)] 
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.

5 years agoDoc: Detect SP/OpenSP automatically
Ondrej Zajicek (work) [Tue, 19 Feb 2019 17:32:45 +0000 (18:32 +0100)] 
Doc: Detect SP/OpenSP automatically

5 years agoNest: Prevent withdraws from propagation back to source protocol (for accepted mode)
Ondrej Zajicek (work) [Tue, 19 Feb 2019 15:21:52 +0000 (16:21 +0100)] 
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.

5 years agoNest: Improve export counter handling
Ondrej Zajicek (work) [Tue, 19 Feb 2019 15:00:30 +0000 (16:00 +0100)] 
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 sending 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).

5 years agoNest: Prevent withdraws from propagation back to source protocol
Ondrej Zajicek (work) [Wed, 30 Jan 2019 16:03:30 +0000 (17:03 +0100)] 
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.

5 years agoDoc: Add documentation for OSPF retransmit delay option
Ondrej Zajicek (work) [Sat, 26 Jan 2019 20:03:36 +0000 (21:03 +0100)] 
Doc: Add documentation for OSPF retransmit delay option

Thanks to Igor Podlesny for notification.

5 years agoAdded documentation for 'disable after cease' v1.6.5
Ondrej Filip [Mon, 7 Jan 2019 11:26:21 +0000 (12:26 +0100)] 
Added documentation for 'disable after cease'

5 years agoNEWS and version update
Ondrej Zajicek (work) [Fri, 4 Jan 2019 23:37:31 +0000 (00:37 +0100)] 
NEWS and version update

5 years agoConfigure: Fix lost suffix in bird.ctl
Ondrej Zajicek (work) [Fri, 4 Jan 2019 18:11:54 +0000 (19:11 +0100)] 
Configure: Fix lost suffix in bird.ctl

One of previous commits bacported from 2.0 removed suffix from bird.ctl

5 years agoBSD: Fix TCP-MD5 code on current FreeBSD kernels
Ondrej Zajicek (work) [Fri, 4 Jan 2019 17:20:56 +0000 (18:20 +0100)] 
BSD: Fix TCP-MD5 code on current FreeBSD kernels

Current FreeBSD kernels require SA records for both directions.

Thanks to Joseph Mulloy and Andrey V. Elsukov for reporting and
solving the issue.

5 years agoDoc: README and INSTALL update
Ondrej Zajicek (work) [Thu, 3 Jan 2019 16:25:33 +0000 (17:25 +0100)] 
Doc: README and INSTALL update

Minor cleanups, updates and clarifications. Also removes (incomplete
and well-known) build steps from README, as they are better described
in INSTALL.

5 years agoDoc: Fix documentation build with newer Linuxdoc-Tools
Ondrej Zajicek (work) [Thu, 3 Jan 2019 16:17:08 +0000 (17:17 +0100)] 
Doc: Fix documentation build with newer Linuxdoc-Tools

5 years agoDoc: Allow overriding $SGML_CATALOG_FILES using distribution specific paths
Robert Scheck [Thu, 20 Dec 2018 12:25:53 +0000 (13:25 +0100)] 
Doc: Allow overriding $SGML_CATALOG_FILES using distribution specific paths

5 years agoDoc: Add alternative path for SGML ISO entities 8879.1986 to $SGML_CATALOG_FILES
Robert Scheck [Thu, 20 Dec 2018 12:25:31 +0000 (13:25 +0100)] 
Doc: Add alternative path for SGML ISO entities 8879.1986 to $SGML_CATALOG_FILES

The existing paths are valid for Debian, alternative paths are necessary
for Fedora and RHEL/CentOS.

5 years agoAutoconf: Minor cleanup
Ondrej Zajicek (work) [Thu, 20 Dec 2018 12:17:30 +0000 (13:17 +0100)] 
Autoconf: Minor cleanup

5 years agoConfigure: Use standard --runstatedir option
Ondrej Zajicek (work) [Thu, 20 Dec 2018 12:15:53 +0000 (13:15 +0100)] 
Configure: Use standard --runstatedir option

Newer Autoconf defines --runstatedir option for setting directory for
run-time variable data. Use it instead our old --with-runtimedir.

5 years agoNest: Fix crash in rta_show() for Babel routes
Ondrej Zajicek (work) [Thu, 20 Dec 2018 12:06:18 +0000 (13:06 +0100)] 
Nest: Fix crash in rta_show() for Babel routes

Some new route source values did not have associated string
in rta_show(), which might caused crash in some cases.

5 years agoLib: Force output type in ip4_addr constructor
Ondrej Zajicek (work) [Thu, 20 Dec 2018 12:01:15 +0000 (13:01 +0100)] 
Lib: Force output type in ip4_addr constructor

Fixes type issue when u64 is pushed into it.

5 years agoFilter: Fix minor bug in accessing bgp_path
Ondrej Zajicek (work) [Thu, 20 Dec 2018 11:59:55 +0000 (12:59 +0100)] 
Filter: Fix minor bug in accessing bgp_path

Not relevant for regular BGP paths, just for BGP paths added by filters
to e.g. static routes.

5 years agoNest: Fix 'show interfaces summary' command
Ondrej Zajicek (work) [Thu, 20 Dec 2018 11:57:43 +0000 (12:57 +0100)] 
Nest: Fix 'show interfaces summary' command

The command showed interfaces that were removed / in shutdown.

5 years agoDoc: Fix description of 'description'
Ondrej Zajicek (work) [Thu, 20 Dec 2018 11:54:52 +0000 (12:54 +0100)] 
Doc: Fix description of 'description'

Thanks to Clemens Schrimpe for the bugreport.

5 years agoIO: Workaround for broken FreeBSD behavior
Ondrej Zajicek (work) [Wed, 19 Dec 2018 17:10:39 +0000 (18:10 +0100)] 
IO: Workaround for broken FreeBSD behavior

FreeBSD silently changes TTL to 1 when MSG_DONTROUTE is used, even when
it is explicitly set to another value. That breaks TTL security sockets,
including BFD which always uses TTL 255. Bad FreeBSD!

5 years agoDoc: Generate MRT progdoc
Ondrej Zajicek (work) [Wed, 19 Dec 2018 15:32:52 +0000 (16:32 +0100)] 
Doc: Generate MRT progdoc

5 years agoDoc: Rename code documentation files back to Doc
Ondrej Zajicek (work) [Wed, 19 Dec 2018 15:29:20 +0000 (16:29 +0100)] 
Doc: Rename code documentation files back to Doc

5 years agoDoc: Move root of code documentation to doc dir
Ondrej Zajicek (work) [Wed, 19 Dec 2018 15:25:59 +0000 (16:25 +0100)] 
Doc: Move root of code documentation to doc dir

It reduces clutter in root and also avoid collision with doc dir on
case-insensitive filesystems when name back to Doc.

5 years agoUnix: Fix variable declarations
Ondrej Zajicek (work) [Wed, 19 Dec 2018 14:52:13 +0000 (15:52 +0100)] 
Unix: Fix variable declarations

5 years agoOSPF: Fix wrong LSA collisions detection
Ondrej Zajicek (work) [Mon, 17 Dec 2018 16:10:59 +0000 (17:10 +0100)] 
OSPF: Fix wrong LSA collisions detection

In some circumstances (old LSA flushed but not acknowledged and not
removed) origination of a new LSA may wrongly triggers LSA collision
code. The patch fixes that.

Thanks to Asbjorn Mikkelsen for the bugreport and @mdelagueronniere
for the original patch.

5 years agoOSPF: Fix reconfiguration of vlinks
Ondrej Zajicek (work) [Mon, 10 Dec 2018 01:05:21 +0000 (02:05 +0100)] 
OSPF: Fix reconfiguration of vlinks

Fix crash during reconfiguration of OSPF config with vlinks. When vlink
is reconfigured, a generic iface-reconfiguration code is used, which in
one place supposes that it is running on a regular iface.

Thanks to Cybertinus for a bugreport.

5 years agoStatic: Fix reset neighbor entries for ECMP routes
Ondrej Zajicek (work) [Tue, 4 Dec 2018 12:52:58 +0000 (13:52 +0100)] 
Static: Fix reset neighbor entries for ECMP routes

Neighbor entries for static ECMP routes were not cleaned up during
reconfigure and pointed to the old instances, which leads to crash
after reconfigure.

Thanks to Vladimir Osmolovskiy for the bugreport.

5 years agoMRT documentation
Ondrej Zajicek (work) [Wed, 21 Nov 2018 14:46:31 +0000 (15:46 +0100)] 
MRT documentation

5 years agoMRT: Fix bug in MRT table dump requested from CLI
Ondrej Zajicek (work) [Tue, 20 Nov 2018 16:40:12 +0000 (17:40 +0100)] 
MRT: Fix bug in MRT table dump requested from CLI

5 years agoNest: Improve keeping track of IPv6 link-local addresses
Ondrej Zajicek (work) [Thu, 8 Nov 2018 19:43:04 +0000 (20:43 +0100)] 
Nest: Improve keeping track of IPv6 link-local addresses

Most protocols in IPv6 mode use link-local source addresses and expect
that there is one on each active interface. The old code depended on
assumption that if there is some IPv6 address on iface, there is also an
IPv6 link-local address on that iface (added by kernel when the iface
went up). Unfortunately, that is not generally true, as a configured
global address sometimes ceases to be tentative (finishes DOD) before
a link-local address on the same iface. In such case a protocol iface
(namely RAdv and Babel) is activated, but fails to found link-local
address and stays in failed state.

The patch fixes that by tracking 'primary' IPv6 link-local address,
sending iface restart notifications when it changes and making
protocols ignore iface-up notifications when no such address is
selected for an iface.

5 years agoFilter: Make ifname attribute modifiable
Ondrej Zajicek (work) [Mon, 5 Nov 2018 20:55:18 +0000 (21:55 +0100)] 
Filter: Make ifname attribute modifiable

Allow to change an interface associated with a route by setting
ifname attribute. It will also change the route to a direct one.

5 years agoOSPF: Fix some trace messages
Ondrej Zajicek (work) [Thu, 25 Oct 2018 15:21:06 +0000 (17:21 +0200)] 
OSPF: Fix some trace messages

Missing argument in MTU change trace message can crash bird when MTU
change happens and trace messages are active.

Thanks to Alexander Velkov for the bugreport.

5 years agoThe MRT protocol
Ondrej Zajicek (work) [Tue, 18 Sep 2018 15:29:00 +0000 (17:29 +0200)] 
The MRT protocol

The new MRT protocol is responsible for periodic RIB table dumps in the
MRT format (RFC 6396). Also the existing code for BGP4MP MRT dumps is
refactored and splitted between BGP to MRT protocols, will be more
integrated into MRT in the future.

Example:

protocol mrt {
table "*";
filename "%N_%F_%T.mrt";
period 60;
}

It is partially based on the old MRT code from Pavel Tvrdik.

5 years agoConf: Show the line:char position where the syntax error happens
Jan Maria Matejka [Tue, 11 Sep 2018 14:55:41 +0000 (16:55 +0200)] 
Conf: Show the line:char position where the syntax error happens

5 years agoBGP: Fix BFD/GR interaction
Ondrej Zajicek (work) [Wed, 1 Aug 2018 15:41:29 +0000 (17:41 +0200)] 
BGP: Fix BFD/GR interaction

The old code does not cause GR if BFD failed when GR is running,
session is re-established but not yet synchronized.

5 years agoBGP: Minor fixes in long-lived graceful restart
Ondrej Zajicek (work) [Wed, 1 Aug 2018 15:35:39 +0000 (17:35 +0200)] 
BGP: Minor fixes in long-lived graceful restart

5 years agoBSD: Use MSG_DONTROUTE for unicast packets on FreeBSD
Ondrej Zajicek (work) [Sat, 28 Jul 2018 14:54:06 +0000 (16:54 +0200)] 
BSD: Use MSG_DONTROUTE for unicast packets on FreeBSD

BSD systems cannot use SO_DONTROUTE, because it does not work properly
with multicast packets (perhaps it tries to find iface based on multicast
group address). But we can use MSG_DONTROUTE sendmsg() flag for unicast
packets. Works on FreeBSD, is ignored on OpenBSD and is broken on NetBSD
(i guess due to integrated routing table and ARP table).

5 years agoMove FreeBSD CFLAGS and LDFLAGS to configure
Ondrej Zajicek (work) [Sat, 28 Jul 2018 13:50:30 +0000 (15:50 +0200)] 
Move FreeBSD CFLAGS and LDFLAGS to configure

Backport of commit 09c1e370b3084f7acb7c3777427670a69945368a.

5 years agoBGP: Long-lived graceful restart enhancements
Ondrej Zajicek (work) [Wed, 4 Jul 2018 14:42:42 +0000 (16:42 +0200)] 
BGP: Long-lived graceful restart enhancements

When use of LLGR is negotiated, handle hold timeout by LLGR instead of by
hard restart. Allow to configure whether BFD session down event should be
handled by GR/LLGR or by hard restart.

5 years agoDoc: Documentation for long-lived graceful restart
Ondrej Zajicek (work) [Tue, 5 Jun 2018 14:02:25 +0000 (16:02 +0200)] 
Doc: Documentation for long-lived graceful restart

5 years agoBGP: Long-lived graceful restart
Ondrej Zajicek (work) [Mon, 4 Jun 2018 16:56:05 +0000 (18:56 +0200)] 
BGP: Long-lived graceful restart

The patch implements long-lived graceful restart for BGP, namely
draft-uttaro-idr-bgp-persistence-03.

5 years agoNest: Fix race condition during reconfiguration, part 2
Ondrej Zajicek (work) [Fri, 6 Jul 2018 00:17:59 +0000 (02:17 +0200)] 
Nest: Fix race condition during reconfiguration, part 2

If export filter is changed during reconfiguration and a route disappears
between reconfiguration and refeed (e.g., if the route is a static route
also removed during the reconfiguration), the route is not withdrawn.

The issue was fixed for regular channels by an earlier patch. This patch
fixes the issue for channels in RA_ACCEPTED mode (first-pass-the-filter),
used by BGP with 'secondary' option.

5 years agoNest: Fix race condition during reconfiguration
Ondrej Zajicek (work) [Tue, 3 Jul 2018 17:21:42 +0000 (19:21 +0200)] 
Nest: Fix race condition during reconfiguration

If export filter is changed during reconfiguration and a route disappears
between reconfiguration and refeed (e.g., if the route is a static route
also removed during the reconfiguration), the route is not withdrawn.
The patch fixes that by adding tx reconfiguration timestamp.

6 years agoAutotools: updated config.guess and config.sub
Maria Matejka [Mon, 23 Apr 2018 13:59:02 +0000 (15:59 +0200)] 
Autotools: updated config.guess and config.sub

Updated to version 63b4ce2e8c28aee6a32133e400436e4ca885215a
from git://git.savannah.gnu.org/config.git

Previous version was 93b5037172b15ad28952481933517f1ba93d125b

6 years agoNetlink: removed dynamic length array as Clang won't support it.
Maria Matejka [Mon, 23 Apr 2018 13:56:50 +0000 (15:56 +0200)] 
Netlink: removed dynamic length array as Clang won't support it.

6 years agoAndroid: check for extra libs needed for build
Maria Matejka [Mon, 23 Apr 2018 13:54:20 +0000 (15:54 +0200)] 
Android: check for extra libs needed for build

6 years agoDoc: renamed progdoc files Doc -> progdoc to fix collision with doc/ folder on case...
Maria Matejka [Mon, 23 Apr 2018 09:29:13 +0000 (11:29 +0200)] 
Doc: renamed progdoc files Doc -> progdoc to fix collision with doc/ folder on case-insensitive filesystems

6 years agoDoc: Remove some superfluous slashes
Ondrej Zajicek (work) [Sat, 24 Mar 2018 00:53:03 +0000 (01:53 +0100)] 
Doc: Remove some superfluous slashes

6 years agoDoc: Be consistent in generating pdf output
Ondrej Zajicek (work) [Sat, 24 Mar 2018 00:34:58 +0000 (01:34 +0100)] 
Doc: Be consistent in generating pdf output

6 years agoAutoconf replaced by autoreconf
Ondrej Filip [Fri, 23 Mar 2018 16:22:55 +0000 (17:22 +0100)] 
Autoconf replaced by autoreconf

6 years agoDate added. v1.6.4
Ondrej Filip [Thu, 22 Mar 2018 12:33:12 +0000 (13:33 +0100)] 
Date added.

6 years agoNEWS and version update
Ondrej Zajicek (work) [Wed, 21 Mar 2018 14:41:24 +0000 (15:41 +0100)] 
NEWS and version update

6 years agoDoc: Minor build fix
Ondrej Zajicek (work) [Wed, 21 Mar 2018 15:22:59 +0000 (16:22 +0100)] 
Doc: Minor build fix

6 years agoC99 loop declarations not allowed in 1.6.x
Ondrej Zajicek (work) [Mon, 19 Mar 2018 18:51:11 +0000 (19:51 +0100)] 
C99 loop declarations not allowed in 1.6.x

6 years agoFilter: make bgpmask literals real constructors
Jan Maria Matejka [Wed, 28 Feb 2018 15:57:50 +0000 (16:57 +0100)] 
Filter: make bgpmask literals real constructors

The bgpmask literals can include expressions. This is OK but they have
to be interpreted as soon as the code is run, not in the time the code
is used as value.

This led to strange behavior like rewriting bgpmasks when they shan't
be rewritten:

function mask_generator(int as)
{
return [= * as * =];
}

function another()
bgpmask m1;
bgpmask m2;
{
m1 = mask_generator(10);
m2 = mask_generator(20);
if (m1 == m2) {
print("strange"); # this would happen
}
}

Moreover, sending this to CLI would cause stack overflow and knock down the
whole BIRD, as soon as there is at least one route to execute the given
filter on.

show route filter bgpmask mmm; bgppath ppp; { ppp = +empty+; mmm = [= (ppp ~ mmm) =]; print(mmm); accept; }

The magic match operator (~) inside the bgpmask literal would try to
resolve mmm, which points to the same bgpmask so it would resolve
itself, call the magic match operator and vice versa.

After this patch, the bgpmask literal will get resolved as soon as it's
assigned to mmm and it also will return a type error as bool is not
convertible to ASN in BIRD.

6 years agoFilters: Removed FI_COMMA, not used for 19 years.
Jan Maria Matejka [Tue, 13 Mar 2018 11:08:37 +0000 (12:08 +0100)] 
Filters: Removed FI_COMMA, not used for 19 years.

This instruction was removed in the commit linked below
and never used ever again. Rest in peace.

commit 84c7e1943f0dbf896b1dd8d02a21120aa00463f4
Author: Pavel Machek <pavel@ucw.cz>
Date:   Tue Mar 2 19:49:28 1999 +0000

6 years agoFilter: recursion to loop
Jan Maria Matejka [Wed, 29 Nov 2017 10:38:01 +0000 (11:38 +0100)] 
Filter: recursion to loop

It was supposed to do tail-recursion in interpret() but it didn't
compile as such. Converting it to loop makes a significant filter
performance improvement for flat filters.

6 years agoFilter: Instruction codes named as enum
Maria Jan Matejka [Thu, 19 Oct 2017 10:39:44 +0000 (12:39 +0200)] 
Filter: Instruction codes named as enum

The two-letter instructions were quite messy but they could be easily
read from memory dumps. Now GDB (since 2012) supports pretty printing
enum values and GCC checks the switch construction for missing enum
values so we are converting the nice two-byte values to enums.

Anyway, the enum still keeps the old two-byte values to be able to read
the instruction codes even without GDB from plain memory dump.

6 years agoBabel: Fix build with restricted protocol set
Ondrej Zajicek (work) [Wed, 7 Mar 2018 16:35:24 +0000 (17:35 +0100)] 
Babel: Fix build with restricted protocol set

All keywords used in Babel config have to be declared locally.

Thanks to Leo Vandewoestijne for the bugreport.

6 years agoIO: Fix socket priority
Ondrej Zajicek (work) [Tue, 23 Jan 2018 16:05:45 +0000 (17:05 +0100)] 
IO: Fix socket priority

On Linux, setting the ToS will also set the priority and the range of
accepted values is quite limited (masked by 0x1e). Therefore, 0xc0 is
translated to a priority of 0, not something we want, overriding the
"7" priority which was set previously explicitely. To avoid that, just
move setting priority later in the code.

Thanks to Vincent Bernat for the patch.

6 years agoBGP: Implement 'disable after cease' option
Ondrej Zajicek (work) [Tue, 16 Jan 2018 18:17:04 +0000 (19:17 +0100)] 
BGP: Implement 'disable after cease' option

The option allows to specify that some cease subcodes should
disable the protocol when received.

6 years agoFilter: Allow silent filter execution
Ondrej Zajicek (work) [Tue, 16 Jan 2018 15:20:01 +0000 (16:20 +0100)] 
Filter: Allow silent filter execution

A filter should log messages only if executed explicitly (e.g., during
route export or route import). When a filter is executed for technical
reasons (e.g., to establish whether a route was exported before), it
should run silently.

6 years agoROA: Fix reconfiguration
Ondrej Zajicek (work) [Wed, 3 Jan 2018 13:12:00 +0000 (14:12 +0100)] 
ROA: Fix reconfiguration

6 years agoRemove libhistory check
Ondrej Zajicek (work) [Tue, 2 Jan 2018 13:11:59 +0000 (14:11 +0100)] 
Remove libhistory check

According to GNU Readline developers, if we link with libreadline then
there is no need to link with libhistory at all.

6 years agoMinor cleanups
Ondrej Zajicek (work) [Thu, 14 Dec 2017 21:15:01 +0000 (22:15 +0100)] 
Minor cleanups

6 years agoBabel: Parse flags in Hello TLV
Ondrej Zajicek (work) [Tue, 28 Nov 2017 18:33:33 +0000 (19:33 +0100)] 
Babel: Parse flags in Hello TLV

RFC6126bis introduces a flags field for the Hello TLV, and adds a unicast flag
that is used to signify that a hello was sent as unicast. This adds parsing of
the flags field and ignores such unicast hellos, which preserves compatibility
until we can add a proper implementation of the unicast hello mechanism.

Thanks to Toke Hoiland-Jorgensen for the patch.

6 years agoFilter test: typo fix
Jan Maria Matejka [Thu, 9 Nov 2017 14:04:05 +0000 (15:04 +0100)] 
Filter test: typo fix

6 years agoDoc: Update sgml2* tools
Ondrej Zajicek (work) [Tue, 10 Oct 2017 13:06:39 +0000 (15:06 +0200)] 
Doc: Update sgml2* tools

The old ones do not work on current Debian.

6 years agoDoc: Fix reference
Ondrej Zajicek (work) [Tue, 10 Oct 2017 11:27:03 +0000 (13:27 +0200)] 
Doc: Fix reference

6 years agoRAdv: Documentation for more specific routes
Michal 'vorner' Vaner [Tue, 19 Sep 2017 15:23:31 +0000 (17:23 +0200)] 
RAdv: Documentation for more specific routes

6 years agoRAdv: Change specific route options to be per-interface
Ondrej Zajicek (work) [Fri, 6 Oct 2017 10:22:18 +0000 (12:22 +0200)] 
RAdv: Change specific route options to be per-interface

And change default values of specific route options to be consistent with
values of default router options.

6 years agoRAdv: Support for more specific routes (RFC 4191)
Michal 'vorner' Vaner [Thu, 31 Aug 2017 13:40:23 +0000 (15:40 +0200)] 
RAdv: Support for more specific routes (RFC 4191)

The patch implements Default Router Preferences and More-Specific Routes
(RFC 4191) for RAdv protocol, allowing to announce router preference and
more specific routes in router advertisements. Routes can be exported to
RAdv like to regular routing protocols.

Some cleanups, bugfixes and other changes done by Ondrej Zajicek.

6 years agofilter: Allow assigning enums into extended attributes
Michal 'vorner' Vaner [Tue, 5 Sep 2017 13:50:00 +0000 (15:50 +0200)] 
filter: Allow assigning enums into extended attributes

They are internally ints, but they got refused as a wrong type. This
fixes setting of the BGP origin and is also needed for RA.

6 years agoBGP: Shutdown communication (RFC 8203)
Ondrej Zajicek (work) [Tue, 19 Sep 2017 17:55:37 +0000 (19:55 +0200)] 
BGP: Shutdown communication (RFC 8203)

The patch implements BGP Administrative Shutdown Communication (RFC 8203)
allowing BGP operators to pass messages related to BGP session
administrative shutdown/restart. It handles both transmit and receive of
shutdown messages. Messages are logged and may be displayed by show
protocol all command.

Thanks to Job Snijders for the basic patch.

6 years agoDocs: FIB iteration macros
Michal 'vorner' Vaner [Thu, 14 Sep 2017 10:31:15 +0000 (12:31 +0200)] 
Docs: FIB iteration macros

6 years agoDoc: Document 'empty' operator
Ondrej Zajicek (work) [Wed, 13 Sep 2017 11:10:50 +0000 (13:10 +0200)] 
Doc: Document 'empty' operator

Thanks to Alexander Zubkov for the notification.