Commit graph

2752 commits

Author SHA1 Message Date
Pavel Tvrdik
768d5e1058 Add !~ operator to filter grammar 2016-09-21 13:35:52 +02:00
Ondrej Zajicek
75ac3d199d Remove cvsignore
We have gitignore
2016-09-21 13:35:47 +02:00
Ondrej Zajicek (work)
6e75d0d27f KRT: Add krt_scope attribute
Add a new route attribute, krt_scope, to expose the Linux kernel route
scope. Constants from /etc/iproute2/rt_scopes (prefixed by "ips_") are
expected to be used with the attribute. Both import and export are
supported.

Also, the patch fixes device route export to the kernel, by setting link
scope automatically.
2016-09-19 12:29:56 +02:00
Pavel Tvrdik
292f7858e6 Main: Improve BIRD help messages 2016-09-15 17:30:52 +02:00
Pavel Tvrdik
6273fcf072 Add stdlib.h to client/commands.c 2016-09-15 17:02:52 +02:00
Pavel Tvrdik
0f5054f685 BFD: Fix invalid read from pollfd array
It is possible that sockets_add() are called between sockets_prepare()
and sockets_fire() during poll loop in birdloop_main(), so we need to
use loop->poll_fd.used instead of loop->sock_num to find the last field.
2016-09-15 16:18:32 +02:00
Pavel Tvrdik
a290da25a1 rt-table: Fix kernel protocol export filter memory bug
Kernel protocol calls rt_export_merged(), which used @rte_update_pool for
temporary allocations, supposing it is called from other functions from
rt-table.c that handles locking and flushing of the linpool. Therefore,
linpool was not flushed properly and memory leaked.

Add linpool argument to rt_export_merged() and use @krt_filter_lp when
called from kernel protocol.

Thanks to Justin Cattle and Alexander Frolkin for the bugreport.

(Commit squashed and updated by Ondrej Zajicek)
2016-09-15 15:57:51 +02:00
Pavel Tvrdik
bc00f05815 Filter: Prefer xmalloc/xfree to malloc/free 2016-09-15 15:24:00 +02:00
Ondrej Zajicek (work)
4adcb9df1b KRT: Add kernel metric protocol option
Kernel routes with different metrics do not clash with each other,
therefore using dedicated metric value is a reliable way to avoid
overwriting routes from other sources (e.g. kernel device routes).

Although kernel route metric could already be set as a route attribute by
filters, that is not consistent with the way how Linux kernel handles
route metric - not just a route attribute, but a part of a route key.
2016-09-15 14:59:06 +02:00
Ondrej Zajicek (work)
2feaa6931b KRT: Support for IPv6 ECMP
Linux represents IPv6 ECMP routes as a sequence of unipath routes with
the same prefix. We have to translate between our representation (one
route with multipath next hop) and the Linux representation in both
directions.

Proper learning of alien IPv6 ECMP routes still not supported.

Thanks to Mikhail Sennikovskii for the original patch.
2016-09-14 11:53:54 +02:00
Ondrej Zajicek (work)
84cac51a51 Nest: Keep multipath next hops sorted 2016-09-14 11:53:54 +02:00
Ondrej Zajicek (work)
a1839f3c61 KRT: Fix trivial error 2016-08-31 14:02:41 +02:00
Ondrej Zajicek (work)
f9f2e280ea KRT: Forbid path merging on BSD
We support ECMP routes only on Linux. Exported routes are checked in
krt_capable(), but a route generated during path merging avoids this
check.
2016-08-30 12:43:46 +02:00
Ondrej Zajicek (work)
768d013267 Merge remote-tracking branch 'origin/misc-fixes' 2016-08-23 17:35:26 +02:00
Ondrej Zajicek (work)
678c97f21e Minor README update 2016-08-23 17:33:00 +02:00
Pavel Tvrdik
d107ef78df Whitespace fixes 2016-08-16 13:02:32 +02:00
Pavel Tvrdik
dbac8793bd Add link to INSTALL in README file 2016-08-16 11:02:30 +02:00
Pavel Tvrdik
9b3d2464cd Rewrote README file
* Made structure with headlines,
* reordered,
* kicked out 'What is missing' part,
* Updated content by home page site and user docs
2016-08-16 10:25:32 +02:00
Ondřej Surý
671ddd5b05 Add .gitignore to ignore generated files 2016-08-16 09:25:50 +02:00
Ondřej Surý
33d22f0e9e whitespace fixes 2016-08-16 09:24:12 +02:00
Ondřej Surý
61e6725335 Include <stdint.h> in cf-lex.l to avoid UINTx_MAX redefinition 2016-08-16 09:23:55 +02:00
Pavel Tvrdik
0ea2afe671 Adds mailing list address at the top of README file 2016-08-15 16:16:36 +02:00
Ondrej Zajicek (work)
13a31a4001 Babel: Immediately update hello interval on interface reconfigure
An interface reconfiguration may change both the hello and update
intervals. An update interval change is immediately put into effect,
while a hello interval change is not. This also updates the hello
interval immediately (if the new interval is shorter than the old one),
and sends a hello to notify peers of the change.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-20 15:55:45 +02:00
Ondrej Zajicek (work)
a08a81c6b4 Netlink: Fix build with older headers missing IFA_FLAGS 2016-07-20 15:31:25 +02:00
Ondrej Zajicek (work)
e37d2e3e70 Netlink: Ignore tentative addresses
Ignore tentative IPv6 addresses and wait until finish of Duplicate
Address Detection (We got notification when an address is no longer
tentative) to avoid problems when protocols try to use interfaces
with tentative link-local addresses.

Based on patch from Jan Moskyto Matejka
2016-07-20 15:06:57 +02:00
Ondrej Zajicek (work)
0a21c21112 Doc: Fix password ID option description
Thanks to Alexander Velkov for noticing it
2016-07-19 15:40:57 +02:00
Ondrej Zajicek (work)
c6ed5a0f99 Babel: Do not maintain feasibility distance for our own routes
We do not need to maintain feasibility distances for our own router
ID (we ignore the updates anyway). Not doing so makes the routes be
garbage collected sooner when export filters change.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 14:38:36 +02:00
Ondrej Zajicek (work)
0f67366601 Babel: Do not keep an infeasible route as selected
When a route becomes infeasible it should not be kept as selected; this
is forbidden by section 3.6 of the RFC and prevents subsequent updates
from the same router ID from replacing it.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 14:28:53 +02:00
Ondrej Zajicek (work)
5d6ca22085 Babel: Send wildcard retractions on shutdown and startup
This makes BIRD send a wildcard retraction on all interfaces before
shutting down and right after starting up. This helps ensure that
neighbours will discard the announced routes as soon as possible,
rather than only after the normal timeout procedures.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 14:23:41 +02:00
Ondrej Zajicek (work)
ecae2f43f3 Babel: Rework handling of retractions
An update with wildcard AE and infinite metric should be treated as a
global retraction of all prefixes announced by that neighbour, per
section 4.4.9 of the RFC. In addition, router ID and seqno in retraction
updates should be ignored. This reworks the handling of retractions and
adjusts the parser to handle all this correctly.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 13:33:02 +02:00
Ondrej Zajicek (work)
12640c1499 Babel: Documentation updates
This updates the documentation to correctly mention Babel when protocols
are listed, and adds examples and route attribute documentation to the
Babel section of the docs.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 12:16:51 +02:00
Ondrej Zajicek (work)
321ff8c404 Babel: Make sure intervals do not overflow
Intervals are carried as 16-bit centisecond values, but kept internally
in 16-bit second values, which causes a potential for overflow. This adds
some checks to make sure this does not happen.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-07-19 11:57:20 +02:00
Ondrej Filip
6887f409f0 Prepare for longer interface names - clean up of the code. 2016-07-17 14:54:52 +02:00
Ondrej Zajicek (work)
ea0cb652e9 BGP: Fix extended messages
Change attribute length limit to handle extended (64 kB) messages.

Do not mix updates and withdraws (RFC 7606).
2016-07-11 20:41:32 +02:00
Ondrej Zajicek (work)
f0b822a831 Log: Fix error handling of debug file open
Logging is not yet initialized, we have to use fprintf() here.

Thanks to Pavel Tvrdik for noticing and debugging it.
2016-07-11 20:22:55 +02:00
Ondrej Zajicek (work)
f1f39bb9d8 Filter: Fixes reconfiguration with last_nonaggregated operator 2016-07-01 11:03:13 +02:00
Ondrej Zajicek (work)
775a5a8195 BGP: Skip empty path segments in received AS_PATH
Although RFC 4271 does not forbid empty path segments, they are useless
and some implementations consider them invalid. It is clarified in RFC 7606,
specifying that AS_PATH with empty segment is considered malformed.
2016-06-29 14:24:32 +02:00
Pavel Tvrdík
8f01879c56 cppcheck: fix va_end() functions 2016-06-27 15:07:50 +02:00
Ondrej Zajicek (work)
122deb6d5b Filters: Fixes pm_same() w.r.t. ASN ranges and ASN expressions
This is necessary for proper detection of filter changes during
reconfigurations.
2016-06-09 00:30:41 +02:00
Ondrej Filip
a0fe1944d1 Add AS# ranges to bgpmask. 2016-06-08 16:22:44 +02:00
Ondrej Filip
90dc0f0843 Small typo in documentation example, submitted by Felix Eckhofer. 2016-06-04 12:38:06 +02:00
Jan Moskyto Matejka
9dbcb11cb5 Unix IO: Tried to fix strange behavior after POLLHUP or POLLERR. 2016-05-30 14:28:22 +02:00
Ondrej Zajicek (work)
3f2c7600fa We don't need bvsnprintf() in BIRD client 2016-05-12 21:44:27 +02:00
Pavel Tvrdik
8e433d6a52 Prog Doc: Complete several missing parameters 2016-05-12 15:49:44 +02:00
Pavel Tvrdik
fff7498d6a User Doc: Fix several typing error 2016-05-12 13:37:23 +02:00
Stijn Tintel
31e9e10144 netlink: update struct msghdr
The netlink code assumes an order for the members of struct msghdr.
This breaks recvmsg and sendmsg with musl libc on mips64. Fix this by
using designated initializers instead.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2016-05-10 16:05:16 +02:00
Pavel Tvrdik
f7a99acb4e Initialize variable ifr in sk_setup()
==00:00:00:02.831 2468== Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s)
==00:00:00:02.831 2468==    at 0x513BDEA: setsockopt (in /usr/lib/libc-2.23.so)
==00:00:00:02.831 2468==    by 0x45C7AF: sk_setup (io.c:1216)
==00:00:00:02.831 2468==    by 0x45CDFF: sk_open (io.c:1417)
==00:00:00:02.831 2468==    by 0x44B562: rip_open_socket (packets.c:740)
==00:00:00:02.831 2468==    by 0x4481A7: rip_iface_locked (rip.c:616)
==00:00:00:02.831 2468==    by 0x4133E4: olock_run_event (locks.c:177)
==00:00:00:02.831 2468==    by 0x45A6DE: ev_run (event.c:85)
==00:00:00:02.831 2468==    by 0x45A7AD: ev_run_list (event.c:142)
==00:00:00:02.831 2468==    by 0x45E0FC: io_loop (io.c:2066)
==00:00:00:02.831 2468==    by 0x463B56: main (main.c:845)
==00:00:00:02.831 2468==  Address 0xffefffd24 is on thread 1's stack
==00:00:00:02.831 2468==  in frame #1, created by sk_setup (io.c:1188)
==00:00:00:02.831 2468==  Uninitialised value was created by a stack allocation
==00:00:00:02.831 2468==    at 0x45C6BB: sk_setup (io.c:1188)
2016-05-03 11:02:48 +02:00
Ondrej Zajicek (work)
1e3810f9f8 Doc: Minor fix 2016-04-29 13:25:46 +02:00
Ondrej Zajicek (work)
52bae25580 NEWS and version update 2016-04-29 13:07:21 +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