Commit graph

231 commits

Author SHA1 Message Date
Ondrej Zajicek (work) f2dd602fef Backport some minor changes from int-new 2017-09-12 16:33:29 +02: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) b845ea097c Remove autoconf macros for time_t and alignment
Replaced by constant compile-time expressions. CPU_STRUCT_ALIGN is not
really correct, but is consistent with the old behavior.
2017-05-16 13:05:00 +02:00
Ondrej Zajicek (work) ed1a908e53 BGP: Fix memory leak in graceful restart code
Prefix and bucket tables are initialized when entering established state
but not explicitly freed when leaving it (that is handled by protocol
restart). With graceful restart, BGP may enter and leave established
state multiple times without hard protocol restart causing memory leak.
2016-11-25 11:51:38 +01:00
Ondrej Zajicek (work) c8cafc8ebb Minor code cleanups 2016-11-08 17:46:29 +01:00
Ondrej Zajicek (work) 920a86e849 Add missing extern 2016-11-03 09:53:53 +01:00
Ondrej Zajicek (work) 390601f038 RIP: Use message authentication interface
Based on former commit from Pavel Tvrdik
2016-11-02 17:53:22 +01:00
Ondrej Zajicek (work) de2a27e255 Add generic message authentication interface
Add generic interface for generating and verifying MACs (message
authentication codes). Replace multiple HMAC implementation with
a generic one.
2016-11-02 16:23:53 +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
Ondrej Zajicek (work) 17fe57d8dc Log: Fix broken syslog name
BIRD passed string from configuration to openlog(), which kept it
internally. After reconfiguration the old string was freed, therefore
openlog had invalid copy.

Thanks to Chris Caputo for the original patch.
2016-11-01 11:37:49 +01:00
Pavel Tvrdik d107ef78df Whitespace fixes 2016-08-16 13:02:32 +02:00
Pavel Tvrdik 8e433d6a52 Prog Doc: Complete several missing parameters 2016-05-12 15:49:44 +02:00
Ondrej Zajicek (work) 937e75d8f1 Add the Babel routing protocol (RFC 6126)
This patch implements the IPv6 subset of the Babel routing protocol.
Based on the patch from Toke Hoiland-Jorgensen, with some heavy
modifications and bugfixes.

Thanks to Toke Hoiland-Jorgensen for the original patch.
2016-04-28 18:01:40 +02:00
Ondrej Zajicek (work) a7baa09862 BSD: Add the IPsec SA/SP database entries control
Add code for manipulation with TCP-MD5 keys in the IPsec SA/SP database
at FreeBSD systems. Now, BGP MD5 authentication (RFC 2385) keys are
handled automatically on both Linux and FreeBSD.

Based on patches from Pavel Tvrdik.
2016-04-13 14:37:09 +02:00
Ondrej Zajicek (work) f2ae2badff Main: Add local option
Add option that changes default paths for config file and control socket
to the current working directory.
2016-04-07 12:39:49 +02:00
Ondrej Zajicek (work) 9e7b3ebdf9 IO: Replace RX priority heuristic with explicit mark
In BIRD, RX has lower priority than TX with the exception of RX from
control socket. The patch replaces heuristic based on socket type with
explicit mark and uses it for both control socket and BGP session waiting
to be established.

This should avoid an issue when during heavy load, outgoing connection
could connect (TX event), send open, but then failed to receive OPEN /
establish in time, not sending notifications between and therefore
got hold timer expired error from the neighbor immediately after it
finally established the connection.
2016-04-06 11:49:34 +02:00
Jan Moskyto Matejka 54bb032d21 Birdlib: Modify lists to avoid problems with pointer aliasing rules
The old linked list implementation used some wild typecasts and required
GCC option -fno-strict-aliasing to work properly. This patch fixes that.
However, we still keep the option due to other potential problems.

(Commited by Ondrej Santiago Zajicek)
2016-03-23 02:21:42 +01:00
Ondrej Zajicek (work) 665b8e5283 Birdlib: Do cleanups after remove/free
To avoid byzantine behavior in case of some errors, linked lists are
cleared after rem_node() and resource headers are cleared after rfree().
2016-03-23 02:21:42 +01:00
Pavel Tvrdík 33b4f40acc MD5: Mormalize naming style 2015-11-24 16:01:48 +01:00
Ondrej Zajicek (work) 90f78507f4 Merge branch 'master' into rip-new 2015-11-24 15:21:11 +01:00
Ondrej Zajicek (work) e422ca0f29 Some consts for function arguments
Patch from Pavel Tvrdik
2015-11-24 13:52:26 +01:00
Ondrej Zajicek (work) 5126380bea Minor changes to SHA hash functions 2015-11-24 13:47:28 +01:00
Pavel Tvrdík f312a837e9 Add SHA-384/512 and HMAC-SHA-384/512 crypto hash 2015-11-13 19:34:12 +01:00
Pavel Tvrdík 4035e0e79c Add SHA-224/256 and HMAC-SHA-224/256 crypto hash 2015-11-13 19:34:02 +01:00
Pavel Tvrdík 5d0c36f1da Add SHA1 and SHA1-HMAC crypto hash 2015-11-13 19:33:48 +01:00
Pavel Tvrdík 75ff08022e Add get_u64() and put_u64() into lib/unaligned.h 2015-11-13 19:31:19 +01:00
Ondrej Zajicek (work) 8465dccb06 Major RIP redesign
The new RIP implementation fixes plenty of old bugs and also adds support
for many new features: ECMP support, link state support, BFD support,
configurable split horizon and more. Most options are now per-interface.
2015-10-05 13:18:10 +02:00
Ondrej Zajicek 8d9eef1771 BGP multipath support
Kernel option 'merge paths' allows to merge routes exported to kernel
protocol (currently BGP and static routes) to multipath routes.
2015-06-08 02:24:08 +02:00
Pavel Tvrdík ae80a2de95 unsigned [int] -> uint 2015-06-08 02:24:08 +02:00
Pavel Tvrdík e348ef01b4 unsgined char -> byte 2015-06-08 02:24:08 +02:00
Ondrej Zajicek 77edab6409 OSPF: Redesign LSA checksumming
New LSA checksumming code separates generic Fletcher-16 and OSPF-specific
code and avoids back and forth endianity conversions, making it much more
readable and also several times faster.
2015-05-01 14:40:56 +02:00
Ondrej Zajicek 8bcb5fb1e8 Implement latency tracking, internal event log and watchdog 2015-03-02 09:41:14 +01:00
Ondrej Zajicek 4e63974471 Add minor comment 2015-02-24 16:19:14 +01:00
Ondrej Zajicek 9c89560e6c Use IP_PORTRANGE_HIGH for BFD where available 2015-02-22 20:14:14 +01:00
Pavel Tvrdík 6264aad16f Minor fixes 2015-02-21 20:11:02 +01:00
Pavel Tvrdik 85a3639d99 Better Clang compatibility 2015-02-21 20:07:17 +01:00
Pavel Tvrdik e598853e68 Add const to a param msg at functions log_msg, log_rl, die, bug and debug 2015-02-21 19:32:57 +01:00
Ondrej Zajicek 6f8bbaa10b Fininshing integrated OSPF. 2014-11-03 10:42:55 +01:00
Ondrej Zajicek 88a183c6c9 Integrated IP functions. 2014-10-24 11:11:43 +02:00
Ondrej Zajicek 78342404ff Merge remote-tracking branch 'origin/master' into soft-int 2014-10-14 17:23:34 +02:00
Ondrej Zajicek 1123e70740 Implements token bucket filter for rate limiting. 2014-10-02 12:52:50 +02:00
Ondrej Zajicek 20e8d040b0 Fixes integer overflow in show memory command.
Thanks to Job Snijders for the bugreport.
2014-06-30 11:55:22 +02:00
Ondrej Zajicek 70945cb645 Temporary integrated OSPF commit. 2014-06-26 11:58:57 +02:00
Ondrej Zajicek 05476c4d04 IPv4/IPv6 integrated socket code. 2014-05-18 11:42:26 +02:00
Ondrej Filip 7c4a800725 Fixed bug in unused function. 2014-04-14 12:28:30 +02:00
Ondrej Zajicek 0c791f873a BGP graceful restart support.
Also significant core protocol state changes needed for that,
global graceful restart recovery state and kernel proto support
for recovery.
2014-03-20 14:07:12 +01:00
Ondrej Zajicek 5c200e0a4d Merge branch 'add-path' 2014-02-06 20:15:05 +01:00
Ondrej Zajicek 48e5f32db6 Many changes in I/O and OSPF sockets and packet handling.
I/O:
 - BSD: specify src addr on IP sockets by IP_HDRINCL
 - BSD: specify src addr on UDP sockets by IP_SENDSRCADDR
 - Linux: specify src addr on IP/UDP sockets by IP_PKTINFO
 - IPv6: specify src addr on IP/UDP sockets by IPV6_PKTINFO
 - Alternative SKF_BIND flag for binding to IP address
 - Allows IP/UDP sockets without tx_hook, on these
   sockets a packet is discarded when TX queue is full
 - Use consistently SOL_ for socket layer values.

OSPF:
 - Packet src addr is always explicitly set
 - Support for secondary addresses in BSD
 - Dynamic RX/TX buffers
 - Fixes some minor buffer overruns
 - Interface option 'tx length'
 - Names for vlink pseudoifaces (vlinkX)
 - Vlinks use separate socket for TX
 - Vlinks do not use fixed associated iface
 - Fixes TTL for direct unicast packets
 - Fixes DONTROUTE for OSPF sockets
 - Use ifa->ifname instead of ifa->iface->name
2014-02-06 17:46:01 +01:00
Ondrej Zajicek e7d2ac4401 Finishes add-path.
Fixes some bugs and uses generic hash implementation.
2013-12-01 13:49:42 +01:00
Ondrej Zajicek 736e143fa5 Merge branch 'master' into add-path
Conflicts:

	filter/filter.c
	nest/proto.c
	nest/rt-table.c
	proto/bgp/bgp.h
	proto/bgp/config.Y
2013-11-23 11:50:34 +01:00