]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
6 years agoFilter: Merged filter line item dumpers into common generated source
Maria Matejka [Tue, 12 Feb 2019 13:16:28 +0000 (14:16 +0100)] 
Filter: Merged filter line item dumpers into common generated source

6 years agoFilter: auto-generating enum-to-string
Maria Matejka [Tue, 12 Feb 2019 10:35:41 +0000 (11:35 +0100)] 
Filter: auto-generating enum-to-string

6 years agoFilter generator: workaround for M4 claiming all the put-around code be on one line
Maria Matejka [Tue, 12 Feb 2019 10:31:18 +0000 (11:31 +0100)] 
Filter generator: workaround for M4 claiming all the put-around code be on one line

6 years agoFilter data manipulation functions separated to their file
Maria Matejka [Mon, 11 Feb 2019 16:12:48 +0000 (17:12 +0100)] 
Filter data manipulation functions separated to their file

6 years agoFilter: split the constructors to a separate file
Maria Matejka [Mon, 11 Feb 2019 15:44:14 +0000 (16:44 +0100)] 
Filter: split the constructors to a separate file

6 years agoConf: Fixed makefiles
Maria Matejka [Mon, 11 Feb 2019 14:27:47 +0000 (15:27 +0100)] 
Conf: Fixed makefiles

6 years agoFilter: merged filter instruction constructors, counting line size on instruction...
Maria Matejka [Fri, 8 Feb 2019 12:38:12 +0000 (13:38 +0100)] 
Filter: merged filter instruction constructors, counting line size on instruction construct

6 years agoTest: Fixed annoying warnings (and possible obscure bugs).
Maria Matejka [Fri, 8 Feb 2019 10:19:04 +0000 (11:19 +0100)] 
Test: Fixed annoying warnings (and possible obscure bugs).

6 years agoFilters: split the large filter.h file to smaller files.
Maria Matejka [Thu, 7 Feb 2019 20:25:38 +0000 (21:25 +0100)] 
Filters: split the large filter.h file to smaller files.

This should be revised, there are still ugly things in the filter API.

6 years agoFilter: M4 convertors polished a bit.
Maria Matejka [Wed, 6 Feb 2019 13:41:39 +0000 (14:41 +0100)] 
Filter: M4 convertors polished a bit.

6 years agoFilter + Config: Fix bugs, tests and split symbols by type
Maria Matejka [Wed, 30 Jan 2019 13:03:47 +0000 (14:03 +0100)] 
Filter + Config: Fix bugs, tests and split symbols by type

6 years agoGDB pretty printers: f_inst and f_val.
Maria Matejka [Wed, 23 Jan 2019 16:08:27 +0000 (17:08 +0100)] 
GDB pretty printers: f_inst and f_val.

6 years agoFilter: refactoring of instruction constructors
Maria Matejka [Mon, 21 Jan 2019 08:17:54 +0000 (09:17 +0100)] 
Filter: refactoring of instruction constructors

6 years agoFilter refactoring: dropped the recursion from the interpreter
Maria Matejka [Thu, 27 Dec 2018 13:26:11 +0000 (14:26 +0100)] 
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.

6 years agoFilter refactoring: The instructions are converted to the switch body by M4
Maria Matejka [Thu, 20 Dec 2018 15:25:54 +0000 (16:25 +0100)] 
Filter refactoring: The instructions are converted to the switch body by M4

6 years agoFilter refactoring: Drop the roa check specific f_inst
Maria Matejka [Thu, 20 Dec 2018 15:07:59 +0000 (16:07 +0100)] 
Filter refactoring: Drop the roa check specific f_inst

6 years agoFilter refactoring: The constant f_val is simply included inside the instruction
Maria Matejka [Thu, 20 Dec 2018 14:25:04 +0000 (15:25 +0100)] 
Filter refactoring: The constant f_val is simply included inside the instruction

With 32 bits, size of the args is 12 bytes, the f_val is 20 bytes.
With 64 bits, size of the args is 24 bytes, the f_val the same.

This is not so nice on 32 bits, anyway the f_inst itself is
24 vs. 32 bytes and the overall size of filters must be 32k of
instructions to get to one megabyte of RAM eaten by f_inst.

Therefore it seems to be improbable for common user to get into
problems with this change.

6 years agoFilter refactoring: Changed arguments from separate unions to an array
Maria Matejka [Thu, 20 Dec 2018 13:55:40 +0000 (14:55 +0100)] 
Filter refactoring: Changed arguments from separate unions to an array

6 years agoFilter refactoring: Converted condition to three-args instruction
Maria Matejka [Thu, 20 Dec 2018 13:34:35 +0000 (14:34 +0100)] 
Filter refactoring: Converted condition to three-args instruction

6 years agoFilter refactoring: Some instructions eat up excessively much space.
Maria Matejka [Thu, 20 Dec 2018 13:29:47 +0000 (14:29 +0100)] 
Filter refactoring: Some instructions eat up excessively much space.

6 years agoFilter refactoring: Expanded the short instructions with common code.
Maria Matejka [Thu, 20 Dec 2018 13:05:32 +0000 (14:05 +0100)] 
Filter refactoring: Expanded the short instructions with common code.

This will make the further changes more straightforward.

6 years agoFilter refactoring: indentation fix
Maria Matejka [Tue, 18 Dec 2018 16:10:05 +0000 (17:10 +0100)] 
Filter refactoring: indentation fix

6 years agoFilter refactoring: The values are now saved on a custom stack.
Jan Maria Matejka [Mon, 17 Dec 2018 14:00:01 +0000 (15:00 +0100)] 
Filter refactoring: The values are now saved on a custom stack.

This shall help with performance.

6 years agoFilter refactoring: Passing the resulting struct f_val as a pointer.
Jan Maria Matejka [Mon, 17 Dec 2018 12:51:11 +0000 (13:51 +0100)] 
Filter refactoring: Passing the resulting struct f_val as a pointer.

This also drops the multiplexing of errors with the f_val itself
together with the T_RETURN f_val type flag.

6 years agoFilter refactoring: Moved filter instruction definition to a separate file
Jan Maria Matejka [Mon, 17 Dec 2018 12:08:08 +0000 (13:08 +0100)] 
Filter refactoring: Moved filter instruction definition to a separate file

6 years agoFilter refactoring: Moved the bitfield bit position formula to route.h
Jan Maria Matejka [Mon, 17 Dec 2018 11:58:01 +0000 (12:58 +0100)] 
Filter refactoring: Moved the bitfield bit position formula to route.h

6 years agoFilter refactoring: Moved the interpret macros inside the block
Jan Maria Matejka [Mon, 17 Dec 2018 11:48:33 +0000 (12:48 +0100)] 
Filter refactoring: Moved the interpret macros inside the block

6 years agoConfigure: Don't check for implicit fallthrough unless when debugging.
Jan Maria Matejka [Mon, 17 Dec 2018 11:45:21 +0000 (12:45 +0100)] 
Configure: Don't check for implicit fallthrough unless when debugging.

6 years agoFilter: Converted static global variables to a filter_state struct.
Jan Maria Matejka [Tue, 27 Feb 2018 14:39:39 +0000 (15:39 +0100)] 
Filter: Converted static global variables to a filter_state struct.

The static filter state was messy and blocked the planned parallel
execution of filters. Anyway, this will be also slower as the state
structure must be passed almost everywhere with us.

6 years agoHTML are no longer generated in srcdir
Ondrej Zajicek (work) [Tue, 19 Feb 2019 17:30:28 +0000 (18:30 +0100)] 
HTML are no longer generated in srcdir

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

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

6 years agoOSPF: Reset LSAs during area type change
Ondrej Zajicek (work) [Sun, 17 Feb 2019 00:54:01 +0000 (01:54 +0100)] 
OSPF: Reset LSAs during area type change

When area is reconfigured to a different type, we need to flush LSAs as
they may not be valid (e.g. NSSA-LSA for non-NSSA area). Also, when we
have have just one OSPF area and that changes type, we could restart OSPF
as there is no state to keep anyway. That solves issue with different
handling of external routes exported to OSPF based of main area type.

6 years agoOSPF: Basic support for DN-bit handling (RFC 4576)
Ondrej Zajicek (work) [Wed, 13 Feb 2019 14:40:22 +0000 (15:40 +0100)] 
OSPF: Basic support for DN-bit handling (RFC 4576)

External LSAs originated by OSPF routers with VPN-PE behavior enabled are
marked by DN flag and they are ignored by other OSPF routers with VPN-PE
enabled.

6 years agoOSPF: Do not originate Router-Information LSA
Ondrej Zajicek (work) [Sat, 9 Feb 2019 15:15:01 +0000 (16:15 +0100)] 
OSPF: Do not originate Router-Information LSA

As we do not have much usage for it yet.

6 years agoMerge remote-tracking branch 'origin/mq-opt'
Ondrej Zajicek (work) [Sat, 9 Feb 2019 14:53:16 +0000 (15:53 +0100)] 
Merge remote-tracking branch 'origin/mq-opt'

6 years agoNest: Improve export counter handling
Ondrej Zajicek (work) [Tue, 5 Feb 2019 18:00:43 +0000 (19: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 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).

6 years agoNest: Report preferred counters also when 'import keep filtered' is enabled
Ondrej Zajicek (work) [Tue, 5 Feb 2019 14:59:26 +0000 (15:59 +0100)] 
Nest: Report preferred counters also when 'import keep filtered' is enabled

Thanks to Michal Nowak for reporting the issue.

6 years agoOSPF: Send direct acknowledgements as unicast
Ondrej Zajicek (work) [Sun, 3 Feb 2019 19:22:40 +0000 (20:22 +0100)] 
OSPF: Send direct acknowledgements as unicast

Direct acknowledgements should be send as unicast to a corresponding
neighbor. Only delayed acks should be send as multicast to all/designated
routers.

6 years agoOSPF: Reject duplicate DBDES packets after dead interval
Ondrej Zajicek (work) [Sun, 3 Feb 2019 16:31:27 +0000 (17:31 +0100)] 
OSPF: Reject duplicate DBDES packets after dead interval

Master may free last DBDES packet immediately. Slave must wait dead
interval before freeing last DBDES packet and then reject duplicate
DBDES packets with SeqNumberMismatch.

6 years agoOSPF: DD seqnum should be initialized only for first attempts
Ondrej Zajicek (work) [Sun, 3 Feb 2019 15:20:37 +0000 (16:20 +0100)] 
OSPF: DD seqnum should be initialized only for first attempts

After SeqNumberMismatch/BadLSReq, we should continue with the old
seqnum++. The old code tries to do that by n->adj, but it was set
nowhere.

6 years agoOSPF: Reject DBDES packets with non-matching MTU
Ondrej Zajicek (work) [Sun, 3 Feb 2019 14:45:43 +0000 (15:45 +0100)] 
OSPF: Reject DBDES packets with non-matching MTU

As it is specified in RFC 2328. The old code just provided warning.

6 years agoNest: Reestablish preferred counters
Ondrej Zajicek (work) [Sat, 2 Feb 2019 12:28:16 +0000 (13:28 +0100)] 
Nest: Reestablish preferred counters

6 years agoPerf: Added forgotten all-protocol options mq-opt
Maria Matejka [Fri, 1 Feb 2019 13:09:01 +0000 (14:09 +0100)] 
Perf: Added forgotten all-protocol options

6 years agoNest: FIB rehash values tweaked for better performance
Maria Matejka [Tue, 29 Jan 2019 14:19:06 +0000 (15:19 +0100)] 
Nest: FIB rehash values tweaked for better performance

6 years agoPerf: Prune the table after every loop to have clean state.
Maria Matejka [Tue, 29 Jan 2019 13:22:55 +0000 (14:22 +0100)] 
Perf: Prune the table after every loop to have clean state.

6 years agoPerf: Write also BIRD version to have all the needed data in the logfile
Maria Matejka [Thu, 31 Jan 2019 14:03:43 +0000 (15:03 +0100)] 
Perf: Write also BIRD version to have all the needed data in the logfile

6 years agoNest: Don't lookup net in table before filters are run.
Maria Matejka [Thu, 31 Jan 2019 14:02:15 +0000 (15:02 +0100)] 
Nest: Don't lookup net in table before filters are run.

Using dummy net instead. This should help with performance on rejected
routes.

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

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

Thanks to Igor Podlesny for notification.

6 years agoDoc: Remove doc for already removed option
Ondrej Zajicek (work) [Sat, 26 Jan 2019 19:44:37 +0000 (20:44 +0100)] 
Doc: Remove doc for already removed option

6 years agoBGP: Cleanup channels when going down
Ondrej Zajicek (work) [Sat, 26 Jan 2019 18:48:16 +0000 (19:48 +0100)] 
BGP: Cleanup channels when going down

When going up, uncleaned old channel state may trigger unexpected
conditions crashing bird.

6 years agoOSPF: Opaque LSAs and Router Information LSA
Ondrej Zajicek (work) [Thu, 24 Jan 2019 21:34:33 +0000 (22:34 +0100)] 
OSPF: Opaque LSAs and Router Information LSA

Add support for OSPFv2 Opaque LSAs (RFC 5250) and for Router Information
LSA (RFC 7770). The second part is here mainly for testing opaque LSAs.

6 years agoNest: Don't make tmp_attr before preexport is called
Jan Maria Matejka [Fri, 14 Dec 2018 15:10:19 +0000 (16:10 +0100)] 
Nest: Don't make tmp_attr before preexport is called

6 years agoNEWS and version update v2.0.3
Ondrej Zajicek (work) [Fri, 4 Jan 2019 23:38:37 +0000 (00:38 +0100)] 
NEWS and version update

6 years agoUnix: Remove removed option from help
Ondrej Zajicek (work) [Fri, 4 Jan 2019 22:49:26 +0000 (23:49 +0100)] 
Unix: Remove removed option from help

Also includes minor cleanup of help.

6 years agoBSD: Fix TCP-MD5 code on current FreeBSD kernels
Ondrej Zajicek (work) [Fri, 4 Jan 2019 16:03:48 +0000 (17:03 +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.

6 years agoDoc: README and INSTALL update
Ondrej Zajicek (work) [Thu, 3 Jan 2019 16:11:56 +0000 (17:11 +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.

6 years agoBGP: Better dispatch of incoming connections
Ondrej Zajicek (work) [Wed, 2 Jan 2019 15:01:21 +0000 (16:01 +0100)] 
BGP: Better dispatch of incoming connections

Since v2 we have multiple listening BGP sockets, and each BGP protocol
has associated one of them. Use listening socket that accepted the
incoming connection as a key in the dispatch process so only BGP
protocols assocaited with that listening socket can be selected.
This is necesary for proper dispatch when VRFs are used.

6 years agoBGP: Postpone setting link_addr
Ondrej Zajicek (work) [Wed, 2 Jan 2019 14:57:14 +0000 (15:57 +0100)] 
BGP: Postpone setting link_addr

It may happen that the LLv6 address for given iface is not defined during
BGP start, so we postpone the check to the the session establishment.

6 years agoKRT: Fix debug messages in netlink code
Arthur Gautier [Fri, 28 Dec 2018 18:38:18 +0000 (19:38 +0100)] 
KRT: Fix debug messages in netlink code

6 years agoIO: Workaround for broken FreeBSD behavior
Ondrej Zajicek (work) [Tue, 18 Dec 2018 18:16:23 +0000 (19:16 +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!

6 years agoPerf: Protocol to measure BIRD performance internally
Maria Matějka [Fri, 26 Oct 2018 07:32:35 +0000 (09:32 +0200)] 
Perf: Protocol to measure BIRD performance internally

This protocol is highly experimental and nobody should use it in
production. Anyway it may help you getting some insight into what eats
so much time in filter processing.

6 years agoDebug: support for -gdwarf-4 is not available everywhere
Jan Maria Matejka [Fri, 14 Dec 2018 14:50:44 +0000 (15:50 +0100)] 
Debug: support for -gdwarf-4 is not available everywhere

6 years agoNest: Handle labels_orig correctly in attribute cache
Ondrej Zajicek (work) [Tue, 18 Dec 2018 13:41:12 +0000 (14:41 +0100)] 
Nest: Handle labels_orig correctly in attribute cache

6 years agoOSPF: Fix wrong LSA collisions detection
Ondrej Zajicek (work) [Mon, 17 Dec 2018 16:01:08 +0000 (17:01 +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.

6 years agoBGP: Extend 'next hop keep' and 'next hop self' options
Ondrej Zajicek (work) [Sun, 16 Dec 2018 22:44:24 +0000 (23:44 +0100)] 
BGP: Extend 'next hop keep' and 'next hop self' options

Extend 'next hop keep' and 'next hop self' options to have boolean values
(enabled / disabled) and also values 'ibgp'/ 'ebgp' to restrict it to
routes received from IBGP / EBGP. This allows to have it enabled by
default in some cases, matches features of other implementations, and
allows to handle some strange cases like EBGP border router with 'next
hop self' also doing IBGP route reflecting.

Change default of 'next hop keep' to enabled for route servers, and
'ibgp' for route reflectors.

Update documentation for these options.

6 years agoNest: Fix handling of ECMP next hop flags
Ondrej Zajicek (work) [Sun, 16 Dec 2018 22:39:53 +0000 (23:39 +0100)] 
Nest: Fix handling of ECMP next hop flags

Flag field was not copied when next hop was cached.

6 years agoNest: fix bug in previous patches related to channel reconfiguration
Ondrej Zajicek (work) [Sun, 16 Dec 2018 21:48:13 +0000 (22:48 +0100)] 
Nest: fix bug in previous patches related to channel reconfiguration

The patch d506263d... blocked adding channel during reconfiguration,
that broke protocols which use the same functiona also during init.
This patch fixes that.

6 years agoBGP: Better handling of non-matching AFI in nexthops
Ondrej Zajicek (work) [Sat, 15 Dec 2018 13:01:57 +0000 (14:01 +0100)] 
BGP: Better handling of non-matching AFI in nexthops

6 years agoDoc: Rename code documentation files back to Doc
Ondrej Zajicek (work) [Fri, 14 Dec 2018 01:03:42 +0000 (02:03 +0100)] 
Doc: Rename code documentation files back to Doc

6 years agoDoc: Move root of code documentation to doc dir
Ondrej Zajicek (work) [Fri, 14 Dec 2018 00:53:32 +0000 (01:53 +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.

6 years agoBGP: Do not prepend ASN in export from non-RS EBGP to RS EBGP
Ondrej Zajicek (work) [Wed, 12 Dec 2018 16:36:54 +0000 (17:36 +0100)] 
BGP: Do not prepend ASN in export from non-RS EBGP to RS EBGP

When route is exported to regular EBGP, local ASN should be prepended to
AS_PATH. When route is propagated by route server (between RS-marked
EBGP peers), it should not change AS_PATH. Question is what to do in
other cases (from non-RS EBGP, IBGP, or locally originated to RS EBGP).

In 1.6.x, we did not prepend ASN in non-RS EBGP or IBGP to RS EBGP, but
we prepended in local to RS EBGP.

In 2.0.x, we changed that so only RS-EBGP to RS-EBGP is not prepended.
We received some negative responses (thanks to heisenbug and Alexander
Zubkov), we decided to change it back. One reason is that it is simple
to modify the AS_PATH by filters, but not possible to un-modify
changes done by BGP itself. Also, as 1.6.x behavior was not really
consistent, the final behavior is that ASN is never prepended when
exported to RS EBGP, like to IBGP.

Note that i do not express an opinion about whether such configurations
are even reasonable.

6 years agoDoc: Document log rotation feature
Ondrej Zajicek (work) [Wed, 12 Dec 2018 15:54:23 +0000 (16:54 +0100)] 
Doc: Document log rotation feature

6 years agoUpdate RFC references
Ondrej Zajicek (work) [Wed, 12 Dec 2018 15:38:30 +0000 (16:38 +0100)] 
Update RFC references

Progdoc comments do not allow SGML tags

6 years agoDoc: Document BGP import table option
Ondrej Zajicek (work) [Wed, 12 Dec 2018 15:04:15 +0000 (16:04 +0100)] 
Doc: Document BGP import table option

6 years agoNest: Update statistics and rx-limit for Adj-RIB-In
Ondrej Zajicek (work) [Tue, 11 Dec 2018 12:52:30 +0000 (13:52 +0100)] 
Nest: Update statistics and rx-limit for Adj-RIB-In

6 years agoBGP: implement Adj-RIB-In
Ondrej Zajicek (work) [Thu, 27 Sep 2018 20:57:55 +0000 (22:57 +0200)] 
BGP: implement Adj-RIB-In

The patch implements optional internal import table to a channel and
hooks it to BGP so it can be used as Adj-RIB-In. When enabled, all
received (pre-filtered) routes are stored there and import filters can
be re-evaluated without explicit route refresh. An import table can be
examined using e.g. 'show route import table bgp1.ipv4'.

6 years agoDoc: Fix typo in previous LinuxDoc change
Ondrej Zajicek (work) [Tue, 11 Dec 2018 17:43:58 +0000 (18:43 +0100)] 
Doc: Fix typo in previous LinuxDoc change

6 years agoNest: Forbid adding channels during reconfiguration
Ondrej Zajicek (work) [Tue, 11 Dec 2018 16:57:14 +0000 (17:57 +0100)] 
Nest: Forbid adding channels during reconfiguration

When a new channel is found during reconfiguration, do force restart
of the protocol, like with any other un-reconfigurable change.

The old behavior was that the new channel was added but remained in down
state, even if the protocol was up, so a manual protocol restart was
often necessary.

In the future this should be improved such that a reconfigurable
channel addition (e.g. direct) is accepted and channel is started,
while an un-reconfigurable addition forces protocol restart.

6 years agoOSPF: Fix reconfiguration of vlinks
Ondrej Zajicek (work) [Mon, 10 Dec 2018 01:11:42 +0000 (02:11 +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.

6 years agoMerge branch 'mq-custom' into int-new
Jan Maria Matejka [Thu, 6 Dec 2018 08:55:34 +0000 (09:55 +0100)] 
Merge branch 'mq-custom' into int-new

6 years agoCustom route attributes
Maria Matejka [Wed, 21 Nov 2018 19:37:11 +0000 (20:37 +0100)] 
Custom route attributes

For local route marking purposes, local custom route attributes may be
defined. These attributes are seamlessly stripped after export filter to
every real protocol like Kernel, BGP or OSPF, they however pass through
pipes. We currently allow at most 256 custom attributes.

This should be much faster than currently used bgp communities
for marking routes.

6 years agoDoc: Allow overriding $SGML_CATALOG_FILES using distribution specific paths
Robert Scheck [Tue, 4 Dec 2018 17:14:04 +0000 (18:14 +0100)] 
Doc: Allow overriding $SGML_CATALOG_FILES using distribution specific paths

6 years agoDoc: Add alternative path for SGML ISO entities 8879.1986 to $SGML_CATALOG_FILES
Robert Scheck [Tue, 4 Dec 2018 17:11:42 +0000 (18:11 +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.

6 years agoUnix: Change debugging options
Ondrej Zajicek (work) [Tue, 4 Dec 2018 15:55:25 +0000 (16:55 +0100)] 
Unix: Change debugging options

The old behavior was that enabling debugging did many nontrivial changes
in BIRD behavior. The patch changes it that these changes are generally
independent. Compiling with --enable-debug now just enables compile-time
debug macros, but do not automatically activate debug mode (-d) nor local
mode (-l). Debug mode with output to file (-D) do not force foreground
mode (-f), therefore there is no need for backgroud option (-b), which is
removed. Also fixes a bug when the default log target in -D mode was
stderr instead of given debug file.

6 years agoHash: mem_hash doesn't modify the memory, declared constant
Jan Maria Matejka [Tue, 27 Nov 2018 07:49:31 +0000 (08:49 +0100)] 
Hash: mem_hash doesn't modify the memory, declared constant

6 years agoRoute table max hash size raised to 2^24.
Jan Maria Matejka [Thu, 1 Nov 2018 11:17:49 +0000 (12:17 +0100)] 
Route table max hash size raised to 2^24.

This is still OK for everybody to fit into RAM and also probably enough
to keep a little collision rate for full BGP table.

6 years agoChanged IPv4 hash function to simple multiplication.
Jan Maria Matejka [Tue, 30 Oct 2018 14:25:32 +0000 (15:25 +0100)] 
Changed IPv4 hash function to simple multiplication.

6 years agoTerminology cleanup: The import_control hook is now called preexport.
Jan Maria Matejka [Wed, 14 Feb 2018 12:42:53 +0000 (13:42 +0100)] 
Terminology cleanup: The import_control hook is now called preexport.

Once upon a time, far far away, there were the old Bird developers
discussing what direction of route flow shall be called import and
export. They decided to say "import to protocol" and "export to table"
when speaking about a protocol. When speaking about a table, they
spoke about "importing to table" and "exporting to protocol".

The latter terminology was adopted in configuration, then also the
bird CLI in commit ea2ae6dd0 started to use it (in year 2009). Now
it's 2018 and the terminology is the latter. Import is from protocol to
table, export is from table to protocol. Anyway, there was still an
import_control hook which executed right before route export.

One thing is funny. There are two commits in April 1999 with just two
minutes between them. The older announces the final settlement
on config terminology, the newer uses the other definition. Let's see
their commit messages as the git-log tool shows them (the newer first):

    commit 9e0e485e50ea74c4f1c5cb65bdfe6ce819c2cee2
    Author: Martin Mares <mj@ucw.cz>
    Date:   Mon Apr 5 20:17:59 1999 +0000

Added some new protocol hooks (look at the comments for better explanation):

make_tmp_attrs          Convert inline attributes to ea_list
store_tmp_attrs         Convert ea_list to inline attributes
import_control          Pre-import decisions

    commit 5056c559c4eb253a4eee10cf35b694faec5265eb
    Author: Martin Mares <mj@ucw.cz>
    Date:   Mon Apr 5 20:15:31 1999 +0000

Changed syntax of attaching filters to protocols to hopefully the final
version:

EXPORT <filter-spec>    for outbound routes (i.e., those announced
by BIRD to the rest of the world).
IMPORT <filter-spec>    for inbound routes (i.e., those imported
by BIRD from the rest of the world).

where <filter-spec> is one of:

ALL                     pass all routes
NONE                    drop all routes
FILTER <name>           use named filter
FILTER { <filter> }     use explicitly defined filter

For all protocols, the default is IMPORT ALL, EXPORT NONE. This includes
the kernel protocol, so that you need to add EXPORT ALL to get the previous
configuration of kernel syncer (as usually, see doc/bird.conf.example for
a bird.conf example :)).

Let's say RIP to this almost 19-years-old inconsistency. For now, if you
import a route, it is always from protocol to table. If you export a
route, it is always from table to protocol.

And they lived happily ever after.

6 years agoNest: Do not hard-reset interface when preferred address is changed
Ondrej Zajicek (work) [Wed, 28 Nov 2018 15:43:17 +0000 (16:43 +0100)] 
Nest: Do not hard-reset interface when preferred address is changed

Modify protocols to use preferred address change notification instead on
depending on hard-reset of interfaces in that case, and remove hard-reset
in that case. This avoids issue when e.g. IPv6 protocol restarts
interface when IPv4 preferred address changed (as hard-reset is
unavoidable and common for whole iface).

The patch also fixes a bug when removing last address does not send
preferred address change notification.

6 years agoAutoconf: Minor cleanup
Ondrej Zajicek (work) [Wed, 21 Nov 2018 15:30:22 +0000 (16:30 +0100)] 
Autoconf: Minor cleanup

6 years agoMRT documentation
Ondrej Zajicek (work) [Wed, 21 Nov 2018 15:00:22 +0000 (16:00 +0100)] 
MRT documentation

6 years agoThe MRT protocol
Ondrej Zajicek (work) [Tue, 20 Nov 2018 16:38:19 +0000 (17:38 +0100)] 
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.

6 years agoUnix: Implement log file size limit / log rotation
Ondrej Zajicek (work) [Wed, 14 Nov 2018 16:16:05 +0000 (17:16 +0100)] 
Unix: Implement log file size limit / log rotation

Allow to specify log file size limit and ensure that log file is rotated
to secondary name to avoid exceeding of log size limit.

The patch also fixes a bug related to keeping old fds open after
reconfiguration and using old fds after 'configure undo'.

6 years agoUnix: Refactor tracked files
Ondrej Zajicek (work) [Tue, 13 Nov 2018 17:13:11 +0000 (18:13 +0100)] 
Unix: Refactor tracked files

We need access to resource in order to free it.

6 years agoConfigure: Use standard --runstatedir option
Ondrej Zajicek (work) [Sun, 18 Nov 2018 00:22:09 +0000 (01:22 +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.

6 years agoFilter: Make ifname attribute modifiable
Ondrej Zajicek (work) [Mon, 5 Nov 2018 21:03:21 +0000 (22:03 +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.

6 years agoNest: Fix crash in rta_show() for RPKI and Babel routes
Ondrej Zajicek (work) [Mon, 5 Nov 2018 12:56:59 +0000 (13:56 +0100)] 
Nest: Fix crash in rta_show() for RPKI and Babel routes

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

6 years agoBGP: Fix VRF for listening socket
Ondrej Zajicek (work) [Fri, 26 Oct 2018 17:11:33 +0000 (19:11 +0200)] 
BGP: Fix VRF for listening socket

Listening socket should be bound to specified interface and VRF.

Thanks to Alexander Zubkov for the bugreport.