Minor code cleanups
BSD: Fix build on OpenBSD broken by previous commit
Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on olderversions of GCC than 5.1, all of them false positive.
Log: Fix broken syslog name
BIRD passed string from configuration to openlog(), which kept itinternally. After reconfiguration the old string was freed, thereforeopenlog had invalid copy.
Thanks to Chris Caputo for the original patch.
NEWS and version update
Kernel socket missing err_hook fix
Thanks to Tim Weippert for bugreport.
KRT: Add krt_scope attribute
Add a new route attribute, krt_scope, to expose the Linux kernel routescope. Constants from /etc/iproute2/rt_scopes (prefixed by "ips_") areexpected to be used with the attribute. Both import and export aresupported.
Also, the patch fixes device route export to the kernel, by setting link...
Main: Improve BIRD help messages
rt-table: Fix kernel protocol export filter memory bug
Kernel protocol calls rt_export_merged(), which used @rte_update_pool fortemporary allocations, supposing it is called from other functions fromrt-table.c that handles locking and flushing of the linpool. Therefore,...
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 avoidoverwriting routes from other sources (e.g. kernel device routes).
Although kernel route metric could already be set as a route attribute by...
KRT: Support for IPv6 ECMP
Linux represents IPv6 ECMP routes as a sequence of unipath routes withthe same prefix. We have to translate between our representation (oneroute with multipath next hop) and the Linux representation in bothdirections.
Proper learning of alien IPv6 ECMP routes still not supported....
KRT: Fix trivial error
KRT: Forbid path merging on BSD
We support ECMP routes only on Linux. Exported routes are checked inkrt_capable(), but a route generated during path merging avoids thischeck.
Netlink: Fix build with older headers missing IFA_FLAGS
Netlink: Ignore tentative addresses
Ignore tentative IPv6 addresses and wait until finish of DuplicateAddress Detection (We got notification when an address is no longertentative) to avoid problems when protocols try to use interfaceswith tentative link-local addresses....
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.
cppcheck: fix va_end() functions
Unix IO: Tried to fix strange behavior after POLLHUP or POLLERR.
Prog Doc: Complete several missing parameters
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 byusing designated initializers instead.
Signed-off-by: Stijn Tintel <firstname.lastname@example.org>
Initialize variable ifr in sk_setup()
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 heavymodifications and bugfixes.
Thanks to Toke Hoiland-Jorgensen for the original patch.
BSD: Add the IPsec SA/SP database entries control
Add code for manipulation with TCP-MD5 keys in the IPsec SA/SP databaseat FreeBSD systems. Now, BGP MD5 authentication (RFC 2385) keys arehandled automatically on both Linux and FreeBSD.
Based on patches from Pavel Tvrdik.
Main: Add local option
Add option that changes default paths for config file and control socketto the current working directory.
IO: Avoid multiple event cycles in one loop cycle.
Event cycle may took too much time and trigger next timer events, soavoid cycling between timer and event cycles inside the loop cycle.
IO: Replace RX priority heuristic with explicit mark
In BIRD, RX has lower priority than TX with the exception of RX fromcontrol socket. The patch replaces heuristic based on socket type withexplicit mark and uses it for both control socket and BGP session waiting...
KRT: Fix route learn scan when route changed
When a kernel route changed, function krt_learn_scan() noticed that andreplaced the route in internal kernel FIB, but after that, functionkrt_learn_prune() failed to propagate the new route to the nest, because...
IO/Poll: fix mistaken variable merge
The events variable is used in the short loop decision. The reasons arenot much clear, keeping this to keep the former behaviour.
Unix: Substituted select -> poll also in congestion checker
It does strange things when even one fd larger than FD_SETSIZE ispassed to select().
Poll: Prevent the improbable case of EAGAIN after POLLIN
Unix: Rework of select-loop to poll-loop
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.
Unix: Fix bug in syslog name handling
Pointer to current_log_name has to be changed even if the name is thesame, because the old one will be invalid/freed after reconfiguration.
Netlink: attribute validation before parsing
Wanted netlink attributes are defined in a table, specifyingtheir size and neediness. Removing the long conditions that did thevalidation before.
Also parsing IPv4 and IPv6 versions regardless on the IPV6 macro.
Nest: Fix bug in device proto
If an interface address notification is received during device protocolshutdown/restart, BIRD crashed.
Thanks to Wei Huang for the bugreport.
Fix compiling with --enable-debug option
Netlink: Allow more than 256 routing tables.
Since 2.6.19, the netlink API defines RTA_TABLE routing attribute toallow 32-bit routing table IDs. Using this attribute to index routingtables at Linux, instead of 8-bit rtm_table field.
Conf: Fixes bug in symbol lookup during reconfiguration
Symbol lookup by cf_find_symbol() not only did the lookup but also addednew void symbols allocated from cfg_mem linpool, which gets broken whenlookups are done outside of config parsing, which may lead to crashes...
IO: Fix the previous bugfix
I should check it after making some trivial changes. The original patchfrom Alexander has it right.
IO: Handle fd values too big for select()
If the number of sockets is too much for select(), we should at leasthandle it with proper error messages and reject new sockets instead ofbreaking the event loop.
Thanks to Alexander V. Chernikov for the patch.
Netlink: Fixes uninitialized variable
Thanks to Pavel Tvrdik for the bugfix
BGP multipath support
Kernel option 'merge paths' allows to merge routes exported to kernelprotocol (currently BGP and static routes) to multipath routes.
KRT: Fixes some minor bugs in kernel protocol
unsigned [int] -> uint
unsgined char -> byte
Fix in the last commit
KRT: Add support for plenty of kernel route metrics
Linux kernel route metrics (RTA_METRICS netlink route attribute) arerepresented 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: Fixes route reload
Did not really worked
KRT: Fixes learning of preferred kernel routes.
When a new route was imported from kernel and chosen as preferred, thenthe old best route was propagated as a withdraw to the kernel protocol.Under some circumstances such withdraw propagated to the BSD kernel could...
KRT: Support for RTM_CHANGE on BSD
Fixes port range socket option
Understand IFF_MULTICAST flag on ifaces in Linux
Unfortunately, some interfaces support multicast but do not havethis flag set, so we use it only as a positive hint.
Thanks to Clint Armstrong for noticing the problem.
BGP: Enhanced route refresh (RFC 7313) support
Also hook feed_done is renamed to feed_end.
Fixes bug in debug dumps
Using 'dump sockets' in IPv6 mode caused crash due to mismatched format string.
Thanks to Pavel Tvrdik for noticing it.
Implement latency tracking, internal event log and watchdog
Use IP_PORTRANGE_HIGH for BFD where available
Use AF_UNSPEC for RTM_GETLINK
This value is specified in documentation.
Store protocol config size inside protocol structure
Make proto_config_new() use this info instead of supplied size.
Add const to a param msg at functions log_msg, log_rl, die, bug and debug
Replacing GNU old-style field designator extension
Fininshing integrated OSPF.
Integrated IP functions.
NEWS and version update.
Implements token bucket filter for rate limiting.
Refresh kernel protocol when interface disappears.
When an interface goes down, (Linux) kernel removes routes pointing tothat ifacem but does not send withdraws for them. We rescan thekernel table to ensure synchronization.
Thanks to Alexander Demenshin for the bugreport.
Fixes some warnings.
Fixes a bug in BSD kernel interfacing code.
The bug was introduced in 05476c4d04a24bdb26fa64e05ab31bc36118f34e.
Ensures that msg_controllen includes last padding.
Although RFC 3542 allows both cases, Theo de Raadt thinkshe knows better, and msg_controllen without last paddingfails on OpenBSD.
Thanks to Job Snijders for the bugreport.
String constants could be used for string option values.
Thanks to Frederik Kriewitz for the patch.
IPv4/IPv6 integrated socket code.
Fixes build on some old systems.
Merge branch 'bgp-grace'
BGP graceful restart support.
Also significant core protocol state changes needed for that,global graceful restart recovery state and kernel proto supportfor recovery.
Fixes longstanding issue with interfaces staying in IF_TMP_DOWN.
Thanks to Pierluigi Rolando and others for the bugreport.
Workaround thread-unsafeness of cli_echo().
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...
Merge branch 'master' into add-path
Use ISO 8601 timeformats by default.
Changes primary addr selection on BSD to respect SIOCGIFADDR ioctl() result.
Thanks to Alexander V. Chernikov for the original patch.
Removes workaround related to import of kernel device routes.
Thanks to Benjamin Cama for notification.
filter/filter.c nest/proto.c nest/rt-table.c proto/bgp/bgp.h proto/bgp/config.Y
Minor fix in log_commit() w.r.t. changes in BFD branch.
Merge commit 'origin/bfd'
Fixes problem with RIP on multiple ifaces on BSD.
RIP sockets for multiple ifaces collided, because we cannot bind toa specific iface on BSD. Workarounded by SO_REUSEPORT.
Thanks to Eugene M. Zheganin for the bugreport.
Fixes an issue when opposite address is mistaken for broadcast on ptp ifaces on BSDs.
Thanks to Lex van Roon for the bugreport and to Alexander V. Chernikovfor examining it and locating the problem.
BFD protocol, ready for release.
Supports OSPF and BGP and also statically configured sessions.
Forces KRT rescan on syncer startup with multi syncer config.
Thanks to Sergey Popovich for the patch.
Flag -f "run in foreground" added as requested by a package maintainter.