Commit graph

3213 commits

Author SHA1 Message Date
Michal 'vorner' Vaner
5a8b1fb047 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.
2017-09-20 15:36:54 +02:00
Ondrej Zajicek (work)
cd1d99611e 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.
2017-09-19 19:57:52 +02:00
Michal 'vorner' Vaner
7b2c5f3d28 Docs: FIB iteration macros 2017-09-19 12:59:41 +02:00
Ondrej Zajicek (work)
18ea2ea759 Doc: Document 'empty' operator
Thanks to Alexander Zubkov for the notification.
2017-09-13 13:10:50 +02:00
Ondrej Zajicek (work)
f2dd602fef Backport some minor changes from int-new 2017-09-12 16:33:29 +02:00
Ondrej Zajicek (work)
9f4908fe78 Nest: VRF support for neighbor cache and olock code
Actually much simpler than expected.
2017-09-12 15:49:36 +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)
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)
9befc7cc4f BSD: Fix alignment issue
Incorrect structure alignment breaks kernel routing table updates on
FreeBSD/ARM (and perhaps other platforms).

Thanks to Eugene Sevastyanov for the original patch.
2017-09-04 22:32:45 +02:00
Michal 'vorner' Vaner
96eace1ea7
Merge branch 'gitlab-ci' 2017-09-04 13:30:13 +02:00
Michal 'vorner' Vaner
5c4dfe0c30
Gitlab CI support
Add configuration and docker definitions for tests and builds in Gitlab
CI platform.

Some of them currently fail, which is a known problem.
2017-09-04 11:25:51 +02:00
Ondrej Zajicek (work)
08b6a617e8 RAdv: Some style nitpicks 2017-08-30 16:34:15 +02:00
Michal 'vorner' Vaner
ec7d6a506e RAdv: Configure how long a dead prefix is advertised 2017-08-30 16:34:15 +02:00
Michal 'vorner' Vaner
e2d2b3ef21 RAdv: Buffer prefixes awhile after they disappear
Keep a cache of all the relevant prefixes we send out. When a prefix
appears, insert it into the cache. If it dies, keep it there for a
while, marked as dead.

Send out the dead prefixes with zero lifetime.
2017-08-30 16:34:15 +02:00
Michal 'vorner' Vaner
3ac5d1ce4c RAdv: Extract prefix option preparation
Put the prefix option preparation into a separate function. We're going
to reuse that bit of code.
2017-08-30 16:34:15 +02:00
Ondrej Zajicek (work)
e7ed9ecba7 Client: Fix include 2017-08-22 14:03:38 +02:00
Michal 'vorner' Vaner
080d9e4ce2
Nicer log output
non-primary is ugly, just omit it (and use primary in the other case).
2017-08-10 14:35:14 +02:00
Michal 'vorner' Vaner
5699a2036c
Less confusing log message
A non-primary address isn't necessarily secondary, that's an independent
flag.
2017-08-10 13:06:05 +02:00
Michal 'vorner' Vaner
15a4421f9c
Fix bird.conf example
Make it syntactically correct, so it is accepted.
2017-08-10 12:32:30 +02:00
Michal 'vorner' Vaner
9b776458ef
Gitignore: File created by autoreconf 2017-08-09 13:39:20 +02:00
Michal 'vorner' Vaner
da390bb11c
Drop stale TODO
A TODO file last updated 5 years ago is useless.
2017-08-09 13:35:55 +02:00
Ondrej Zajicek (work)
69f7399247 Merge branch 'master' into int-new 2017-08-09 12:46:27 +02:00
Ondrej Zajicek (work)
b3fae3a817 RAdv: Fix typo 2017-08-09 12:41:44 +02:00
Michal 'vorner' Vaner
1f182675c8 RAdv: Style updates
Adapt the naming conventions to be a bit closer to the other protocols.

proto_radv -> radv_proto
struct radv_proto *ra -> struct radv_proto *p
struct proto *p -> struct proto *P
2017-08-09 12:38:20 +02:00
Michal 'vorner' Vaner
5a41eed26d RAdv: Style updates
Adapt the naming conventions to be a bit closer to the other protocols.

proto_radv -> radv_proto
struct radv_proto *ra -> struct radv_proto *p
struct proto *p -> struct proto *P
2017-08-09 12:22:15 +02:00
Michal 'vorner' Vaner
637ed49868 radv: Fix RFC reference in comments 2017-08-09 11:59:36 +02:00
Michal 'vorner' Vaner
afd9845e26
radv: Fix RFC reference in comments 2017-08-04 10:52:57 +02:00
Martin Mares
b4a33e21ea Configure: Fix a typo in checking of backtrace() 2017-07-19 13:46:48 +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)
e46128fb50 Filters: Do not clamp EC set values to 16 bit for EC_GENERICs
Thanks to Lennert Buytenhek <buytenh@wantstofly.org> for the patch.
2017-06-19 12:46:40 +02:00
Ondrej Zajicek (work)
5220cb63e3 Babel: Fix pointer arithmetic in subtlv parsing
The subtlv parsing code was doing byte-based arithmetic with non-void pointers,
causing it to read beyond the end of the packet.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2017-06-14 12:34:43 +02:00
Ondrej Zajicek (work)
145ebfa1df Babel: Parse sub-TLVs and skip TLVs with mandatory sub-TLV
RFC6126bis formally introduces sub-TLVs to the Babel protocol, including
mandatory sub-TLVs. This adds support for parsing sub-TLVs to the Babel
protocol and skips TLVs that contain mandatory sub-TLVs, as per the spec.

For details, see section 4.4 of
https://tools.ietf.org/html/draft-ietf-babel-rfc6126bis-02

Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
2017-06-09 14:33:06 +02:00
Ondrej Zajicek (work)
b3c6273efa Babel: Implement IPv6 prefix compression on outgoing updates
Previously, the Babel protocol would never use prefix compression on outgoing
updates (but would parse it on incoming ones). This adds compression of IPv6
addresses of outgoing updates.

The compression only works to the extent that the FIB is walked in lexicographic
order; i.e. a prefix is only compressed if it shares bytes with the previous
prefix in the same packet.

Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
2017-06-09 13:00:20 +02:00
Ondrej Zajicek (work)
300bd0eb85 Babel: Add documentation for dual-stack operation and options
This updates the documentation for the Babel protocol to mention the fact
that it now supports dual-stack operation, and adds documentation for the
new next hop options.

Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
2017-06-09 11:56:20 +02:00
Ondrej Zajicek (work)
4324025f98 Babel: Add support for dual-stack IPv4/IPv6 operation
This adds support for dual-stack v4/v6 operation to the Babel protocol.
Routing messages will be exchanged over IPv6, but IPv4 routes can be
carried in the messages being exchanged. This matches how the reference
Babel implementation (babeld) works.

The nexthop address for v4 can be configured per interface, and will
default to the first available IPv4 address on the given interface. For
symmetry, a configuration option to configure the IPv6 nexthop address
is also added.

Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for the patch.
2017-06-08 12:18:16 +02:00
Ondrej Zajicek (work)
801fd81efe Merge branch 'master' into int-new 2017-05-31 14:12:03 +02:00
Ondrej Zajicek (work)
33f7fbc42d CLI: Fix bug in symbol handling introduced in previous patches 2017-05-31 14:11:40 +02:00
Ondrej Zajicek (work)
77810030d2 Merge branch 'master' into int-new 2017-05-30 14:44:37 +02:00
Ondrej Zajicek (work)
4fec43067e Workaround for older bisons 2017-05-30 14:43:49 +02:00
Ondrej Zajicek (work)
a1dc526760 Merge branch 'master' into int-new 2017-05-25 23:37:50 +02:00
Ondrej Zajicek (work)
b7761af34d Conf: Replace keyword and symbol hash table with generic hash table.
The old hash table had fixed size, which makes it slow for config files
with large number of symbols and symbol lookups. The new one is growing
according to needs.
2017-05-25 23:30:39 +02:00
Ondrej Zajicek (work)
4b2aef8857 Merge branch 'master' into int-new 2017-05-23 18:45:33 +02:00
Ondrej Zajicek (work)
c72b660b74 Client: Fix isspace() calls
Function isspace() expects to get *unsigned* chars (encoded as ints),
not that it matters for plain ASCII.
2017-05-23 18:39:20 +02:00
Ondrej Zajicek (work)
6aaaa63519 Change parser to handle numbers as unsigned
Lexer always parsed numbers as unsigned, but parser handled them as
signed and grammar contained many unnecessary checks for negativity.
2017-05-23 17:40:19 +02:00
Pavel Tvrdik
0705a1c565 Add a hint for an invalid IP prefix
bird> eval 200.210.220.0/16
Invalid IPv4 prefix 200.210.220.0/16, maybe you wanted 200.210.0.0/16

bird> eval 1000:2000::/8
Invalid IPv6 prefix 1000:2000::/8, maybe you wanted 1000::/8
2017-05-23 15:59:27 +02:00
Ondrej Zajicek (work)
734e9fb8a9 Minor cleanups and fixes 2017-05-23 13:12:25 +02:00
Ondrej Zajicek (work)
bb7aa06a48 Fix type mixing in flowspec formatting
Variable of u64 type was passed to vararg function as uint.
2017-05-19 00:36:37 +02:00
Ondrej Zajicek (work)
e521150b8f Fix VPN-RD parsing on 32-bit systems
When shift count >= width of type the behavior is undefined.
2017-05-18 14:51:36 +02:00
Ondrej Zajicek (work)
5a9169e152 Merge branch 'master' into int-new 2017-05-18 14:28:03 +02:00
Ondrej Zajicek (work)
78e4dac993 Fix some forgotten warnings 2017-05-18 14:26:57 +02:00