summaryrefslogtreecommitdiff
path: root/sysdep/unix
AgeCommit message (Collapse)Author
2018-12-19IO: Workaround for broken FreeBSD behaviorOndrej Zajicek (work)
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!
2018-12-19Doc: Rename code documentation files back to DocOndrej Zajicek (work)
2018-12-19Unix: Fix variable declarationsOndrej Zajicek (work)
2018-09-18The MRT protocolOndrej Zajicek (work)
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-09-11Conf: Show the line:char position where the syntax error happensJan Maria Matejka
2018-07-28BSD: Use MSG_DONTROUTE for unicast packets on FreeBSDOndrej Zajicek (work)
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-04-23Doc: renamed progdoc files Doc -> progdoc to fix collision with doc/ folder ↵Maria Matejka
on case-insensitive filesystems
2018-01-23IO: Fix socket priorityOndrej Zajicek (work)
On Linux, setting the ToS will also set the priority and the range of accepted values is quite limited (masked by 0x1e). Therefore, 0xc0 is translated to a priority of 0, not something we want, overriding the "7" priority which was set previously explicitely. To avoid that, just move setting priority later in the code. Thanks to Vincent Bernat for the patch.
2018-01-16Filter: Allow silent filter executionOndrej Zajicek (work)
A filter should log messages only if executed explicitly (e.g., during route export or route import). When a filter is executed for technical reasons (e.g., to establish whether a route was exported before), it should run silently.
2017-09-06Basic VRF supportOndrej Zajicek (work)
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-05-18Fix some forgotten warningsOndrej Zajicek (work)
2017-05-16Remove autoconf macros for time_t and alignmentOndrej Zajicek (work)
Replaced by constant compile-time expressions. CPU_STRUCT_ALIGN is not really correct, but is consistent with the old behavior.
2017-05-16Minor autoconf cleanup and documentation updateOndrej Zajicek (work)
2017-05-16Some more autoconf cleanupsOndrej Zajicek (work)
Replace integer type width detection with C99 fixed-width types. Also remove some unused or obsolete code. Thanks to Ruben Kerkhof for the patchset.
2016-12-20Netlink: fix occasional netlink hangs on busy machinesJan Moskyto Matejka
2016-11-08Minor code cleanupsOndrej Zajicek (work)
2016-11-01Build: switch on -Wextra, get rid of most of the warningsJan Moskyto Matejka
There are several unresolved -Wmissing-field-initializers on older versions of GCC than 5.1, all of them false positive.
2016-11-01Log: Fix broken syslog nameOndrej Zajicek (work)
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-09-29Kernel socket missing err_hook fixJan Moskyto Matejka
Thanks to Tim Weippert for bugreport.
2016-09-15Main: Improve BIRD help messagesPavel Tvrdik
2016-09-15rt-table: Fix kernel protocol export filter memory bugPavel Tvrdik
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-08-31KRT: Fix trivial errorOndrej Zajicek (work)
2016-08-30KRT: Forbid path merging on BSDOndrej Zajicek (work)
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-16whitespace fixesOndřej Surý
2016-07-11Log: Fix error handling of debug file openOndrej Zajicek (work)
Logging is not yet initialized, we have to use fprintf() here. Thanks to Pavel Tvrdik for noticing and debugging it.
2016-06-27cppcheck: fix va_end() functionsPavel Tvrdík
2016-05-30Unix IO: Tried to fix strange behavior after POLLHUP or POLLERR.Jan Moskyto Matejka
2016-05-12Prog Doc: Complete several missing parametersPavel Tvrdik
2016-05-03Initialize variable ifr in sk_setup()Pavel Tvrdik
==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-04-13BSD: Add the IPsec SA/SP database entries controlOndrej Zajicek (work)
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-07Main: Add local optionOndrej Zajicek (work)
Add option that changes default paths for config file and control socket to the current working directory.
2016-04-06IO: Avoid multiple event cycles in one loop cycle.Ondrej Zajicek (work)
Event cycle may took too much time and trigger next timer events, so avoid cycling between timer and event cycles inside the loop cycle.
2016-04-06IO: Replace RX priority heuristic with explicit markOndrej Zajicek (work)
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-06KRT: Fix route learn scan when route changedOndrej Zajicek (work)
When a kernel route changed, function krt_learn_scan() noticed that and replaced the route in internal kernel FIB, but after that, function krt_learn_prune() failed to propagate the new route to the nest, because it confused the new route with the (removed) old best route and decided that the best route did not changed. Wow, the original code (and the bug) is almost 17 years old.
2016-03-30IO/Poll: fix mistaken variable mergeJan Moskyto Matejka
The events variable is used in the short loop decision. The reasons are not much clear, keeping this to keep the former behaviour.
2016-03-18Unix: Substituted select -> poll also in congestion checkerJan Moskyto Matejka
It does strange things when even one fd larger than FD_SETSIZE is passed to select().
2016-03-15Poll: Prevent the improbable case of EAGAIN after POLLINJan Moskyto Matejka
2016-03-11Unix: Rework of select-loop to poll-loopJan Moskyto Matejka
This should lift the limit of FD_SETSIZE and allow more than 1024 fd's. FD_SETSIZE limit doesn't matter now when creating new sockets.
2016-02-11Unix: Fix bug in syslog name handlingOndrej Zajicek (work)
Pointer to current_log_name has to be changed even if the name is the same, because the old one will be invalid/freed after reconfiguration.
2015-11-23Nest: Fix bug in device protoOndrej Zajicek (work)
If an interface address notification is received during device protocol shutdown/restart, BIRD crashed. Thanks to Wei Huang for the bugreport.
2015-11-11Netlink: Allow more than 256 routing tables.Jan Moskyto Matejka
Since 2.6.19, the netlink API defines RTA_TABLE routing attribute to allow 32-bit routing table IDs. Using this attribute to index routing tables at Linux, instead of 8-bit rtm_table field.
2015-11-09Conf: Fixes bug in symbol lookup during reconfigurationOndrej Zajicek (work)
Symbol lookup by cf_find_symbol() not only did the lookup but also added new void symbols allocated from cfg_mem linpool, which gets broken when lookups are done outside of config parsing, which may lead to crashes during reconfiguration. The patch separates lookup-only cf_find_symbol() and config-modifying cf_get_symbol(), while the later is called only during parsing. Also new_config and cfg_mem global variables are NULLed outside of parsing.
2015-11-03IO: Fix the previous bugfixOndrej Zajicek (work)
I should check it after making some trivial changes. The original patch from Alexander has it right.
2015-11-03IO: Handle fd values too big for select()Ondrej Zajicek (work)
If the number of sockets is too much for select(), we should at least handle it with proper error messages and reject new sockets instead of breaking the event loop. Thanks to Alexander V. Chernikov for the patch.
2015-06-08BGP multipath supportOndrej Zajicek
Kernel option 'merge paths' allows to merge routes exported to kernel protocol (currently BGP and static routes) to multipath routes.
2015-06-08KRT: Fixes some minor bugs in kernel protocolOndrej Zajicek
2015-06-08unsigned [int] -> uintPavel Tvrdík
2015-05-12KRT: Add support for plenty of kernel route metricsOndrej Zajicek
Linux kernel route metrics (RTA_METRICS netlink route attribute) are represented and accessible as new route attributes: krt_mtu, krt_window, krt_rtt, krt_rttvar, krt_sstresh, krt_cwnd, krt_advmss, krt_reordering, krt_hoplimit, krt_initcwnd, krt_rto_min, krt_initrwnd, krt_quickack, krt_lock_mtu, krt_lock_window, krt_lock_rtt, krt_lock_rttvar, krt_lock_sstresh, krt_lock_cwnd, krt_lock_advmss, krt_lock_reordering, krt_lock_hoplimit, krt_lock_rto_min, krt_feature_ecn, krt_feature_allfrag
2015-04-25KRT: Fixes route reloadOndrej Zajicek
Did not really worked
2015-04-25KRT: Fixes learning of preferred kernel routes.Ondrej Zajicek
When a new route was imported from kernel and chosen as preferred, then the old best route was propagated as a withdraw to the kernel protocol. Under some circumstances such withdraw propagated to the BSD kernel could remove the new alien route and thus reverting the import.