Commit graph

3280 commits

Author SHA1 Message Date
Ondrej Zajicek (work) baeacdcfd3 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.
2018-12-10 02:15:06 +01:00
Jan Maria Matejka 9a5ef043c1 Merge branch 'mq-custom' into int-new 2018-12-06 09:55:34 +01:00
Maria Matejka 265419a369 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.
2018-12-06 09:55:21 +01:00
Robert Scheck 0e4920632a Doc: Allow overriding $SGML_CATALOG_FILES using distribution specific paths 2018-12-04 18:14:04 +01:00
Robert Scheck f26bf60fb5 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.
2018-12-04 18:11:42 +01:00
Ondrej Zajicek (work) 3fda08e405 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.
2018-12-04 16:55:25 +01:00
Jan Maria Matejka 0642fb4d45 Hash: mem_hash doesn't modify the memory, declared constant 2018-12-04 14:00:53 +01:00
Jan Maria Matejka d73c4ac869 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.
2018-12-04 14:00:44 +01:00
Jan Maria Matejka 84661bf6da Changed IPv4 hash function to simple multiplication. 2018-12-04 14:00:28 +01:00
Jan Maria Matejka 14375237f6 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 9e0e485e50
    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 5056c559c4
    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.
2018-12-04 10:53:01 +01:00
Ondrej Zajicek (work) e2ae08694e 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.
2018-11-28 16:55:32 +01:00
Ondrej Zajicek (work) 66934aceff Autoconf: Minor cleanup 2018-11-21 16:30:22 +01:00
Ondrej Zajicek (work) fc1b933304 MRT documentation 2018-11-21 16:00:22 +01:00
Ondrej Zajicek (work) 863ecfc785 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.
2018-11-20 17:45:35 +01:00
Ondrej Zajicek (work) 6712e77271 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'.
2018-11-18 14:03:50 +01:00
Ondrej Zajicek (work) c68ba7d093 Unix: Refactor tracked files
We need access to resource in order to free it.
2018-11-18 14:03:50 +01:00
Ondrej Zajicek (work) d0b4597842 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.
2018-11-18 01:22:09 +01:00
Ondrej Zajicek (work) f2d8e6801e 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.
2018-11-05 22:03:21 +01:00
Ondrej Zajicek (work) 69b2f63d9a 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.
2018-11-05 13:56:59 +01:00
Ondrej Zajicek (work) e19d08055a BGP: Fix VRF for listening socket
Listening socket should be bound to specified interface and VRF.

Thanks to Alexander Zubkov for the bugreport.
2018-10-26 19:11:33 +02:00
Ondrej Zajicek (work) 0ac9cb2c1f 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.
2018-10-25 17:22:37 +02:00
Ondrej Zajicek (work) df50598f1c Lib: Force output type in ip4_addr constructor
Fixes type issue when u64 is pushed into it.
2018-10-25 12:39:13 +02:00
Ondrej Zajicek (work) 83715aa829 Filter: Add support for VPN_RD sets 2018-10-25 11:26:58 +02:00
Ondrej Zajicek (work) 41b83e52f7 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.
2018-10-25 11:23:15 +02:00
Ondrej Zajicek (work) 01dd78f9e9 Fix installation with --disable-client
The old check assumed that @CLIENT@ does not contain
birdc, which is not true in 2.0 branc.

Thanks to Thomas Petazzoni for the bugreport and original patch.
2018-10-11 15:03:09 +02:00
Ondrej Zajicek (work) addb1bcd86 Nest: Fix 'show interfaces summary' command
The command showed interfaces that were removed / in shutdown.
2018-10-11 14:39:13 +02:00
Ondrej Zajicek (work) 961671c0f5 Lib: Add and use ev_new_init() 2018-10-01 15:55:23 +02:00
Ondrej Zajicek (work) 0db7a1d69c BGP: Fix bug in show protocol related to LLGR
When channel is not active due to not be negotiated during sessino
establishment, the LLGR timer is not allocated, so we should not show it.
2018-10-01 15:35:43 +02:00
Jan Maria Matejka d4cebc6bbe No more warnings ...
no more warnings
No more warnings over me
And while it is being compiled all the log is black and white
Release BIRD now and then let it flee

(use the melody of well-known Oh Freedom!)
2018-09-18 14:21:11 +02:00
Jan Maria Matejka d50b0bc437 Conf: Show the line:char position where the syntax error happens 2018-09-11 17:35:13 +02:00
Jan Maria Matejka 89b0af3978 Main: Add -b to force background even in debug mode 2018-08-28 16:48:52 +02:00
Ondrej Zajicek (work) a043f2d794 Doc: Fix description of 'description'
Thanks to Clemens Schrimpe for the bugreport.
2018-08-24 18:58:06 +02:00
Jan Maria Matejka 64c5ad58d2 Lib: recursive printf
Use like this:

void func(const char *msg, va_list args) {
  ...
  bvsnprintf(buf, len, "file %s, line %d: %V (foo %d, bar %d)", file, line, msg, &args, foo, bar);
  ...
}
2018-08-22 15:14:06 +02:00
Ondrej Zajicek (work) 765f400f6b DOC: Remove pipe mode reference
Pipe mode was removed in 2.0, remove reference to it in the documentation.

Thanks to Piotr Wydrych for the bugreport.
2018-08-21 15:24:55 +02:00
Jan Maria Matejka 7ffc0a6534 Bison: A bit more verbose error messages in config. 2018-08-14 14:36:44 +02:00
Jan Maria Matejka 78ca6ea8f0 Make: Add option to force colors in compiler output 2018-08-14 14:01:39 +02:00
Jan Maria Matejka 86b9e8e39a M4: generate synchronization lines
This also includes Bison version check. Versions before 3.0 don't
support them in a reliable way and we don't promise to work with
versions older than 2.4.
2018-08-14 14:01:39 +02:00
Pavel Tvrdik 1279a83103 sysdep/unix/main.c: Remove trailing spaces 2018-08-13 14:10:00 +02:00
Ondrej Zajicek (work) d33cf3f4c3 Doc: Fix notes related to obsolete option
Thanks to Julien Dessaux for the report.
2018-08-07 14:46:24 +02:00
Ondrej Zajicek (work) 5bd734317c BGP: Long-lived graceful restart
The patch implements long-lived graceful restart for BGP, namely
draft-uttaro-idr-bgp-persistence-03.
2018-07-31 18:40:38 +02:00
Ondrej Zajicek (work) 318acb0f6c 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).
2018-07-28 16:54:06 +02:00
Ondrej Zajicek (work) 0ed3129f6b RAdv: Fix crash during prefix change
Thanks to Julian Schuh for the bugreport.
2018-07-19 20:54:55 +02:00
Ondrej Zajicek (work) 8bd718b3ba OSPF: Fix crash during route removal
The bug was introduced by an earler patch which removed additional eattr
argument to rt_notify hook.
2018-07-19 20:48:13 +02:00
Ondrej Zajicek (work) 092c493027 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.
2018-07-06 02:04:45 +02:00
Ondrej Zajicek (work) 7b9b0c0a00 Cleanup some warnings 2018-07-03 18:08:35 +02:00
Ondrej Zajicek (work) a81e18da25 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.
2018-07-03 18:00:52 +02:00
Ondrej Zajicek (work) 8e86ffce82 BGP: Use implicit-NULL label when announcing MPLS routes with local next-hop
We currently cannot assing local labels, but we can still be LSP egress
router. Therefore when we announce labeled route with local next-hop, we
should announce implicit-NULL label instead of rejecting it completely.
2018-07-01 01:03:16 +02:00
Ondrej Zajicek (work) 93c1defdb0 BGP: Fix parsing of MPLS withdrawals
RFC 3107 was bit vague with regard to labeled withdrawals, RFC 8277
clarified that. The old code was incompatible with some implementations,
namely with Juniper.

Thanks to Vadim Fedorenko for the original patch.
2018-07-01 00:43:24 +02:00
Maria Jan Matejka daf113ac66 BGP: Attribute set function merged with its common counterpart 2018-06-29 17:26:28 +02:00
Ondrej Zajicek (work) d8e816c150 BSD: Fix of the previous commit 2018-06-27 17:10:01 +02:00