summaryrefslogtreecommitdiff
path: root/sysdep
AgeCommit message (Collapse)Author
2024-07-05Wg-user: improve rx_hookMikael Magnusson
Fix possible buffer overrun in rx_hook. Let err_hook close socket instead of rx_hook.
2024-07-05Unix: disable some debug outputMikael Magnusson
2024-07-05Wg-user: debugMikael Magnusson
2024-07-05Unix: debugMikael Magnusson
2024-07-05TunnelEncaps: Initial commitMikael Magnusson
2024-07-05Wg-user: Work-around listen_port mutex dead lockMikael Magnusson
Problem with listen_port dead lock in wireguard-go.
2024-07-05Wg-user: Add wireguard unix socket implementationMikael Magnusson
Unix socket implementation for wireguard-go. Use abstract unix sockets on Android
2024-07-05Wireguard-lib: Import wireguard libraryMikael Magnusson
Add to makefile.
2024-07-05Unix: Implement sk_connect_unixMikael Magnusson
Support abstract socket in sk_unix_connect Implement SK_UNIX_ACTIVE
2024-06-27Additional CLI sockets may now be restrictedMaria Matejka
This allows to have one main socket for the heavy operations very restricted just for the appropriate users, whereas the looking glass socket may be more open. Implemented an idea originally submitted and requested by Akamai.
2024-06-27Additional CLI sockets can be now configured in the config fileMaria Matejka
If the user has such a need, they may configure additional sockets in the config file. This may work for e.g. some advanced access control.
2024-06-27CLI now has a configuration structureMaria Matejka
2024-06-26BFD: Add option to accept zero checksum for IPv6 UDP packetsAlexander Zubkov
Some vendors do not fill the checksum for IPv6 UDP packets. For interoperability with such implementations one can set UDP_NO_CHECK6_RX socket option on Linux. Thanks to Ville O for the suggestion. Minor changes by committer.
2024-05-30Kernel: Do not use route replace when krt_metric differsOndrej Zajicek
The krt_metric is a part of the primary key, so it cannot differ for route replace operation. Thanks to Leif Jakob for the bugreport.
2024-03-25Expanded usage of stdbool.h to the whole BIRDMaria Matejka
2024-03-22NEWS and version updateOndrej Zajicek
2024-03-10NEWS and version updateOndrej Zajicek
2024-02-16Netlink: Fix spelling of krt_ssthresh / krt_lock_ssthreshOndrej Zajicek
BIRD route attribute for RTAX_SSTHRESH metric was krt_sstresh instead of krt_ssthresh. Fix that and keep old name as an depreacted alias.
2024-02-16Netlink: Cleanups in route metricsOndrej Zajicek
- Add krt_fastopen_no_cookie atttibute - Add missing krt_lock_* bits - Fix krt_feature_allfrag - Fix type of EA_KRT_LOCK and EA_KRT_FEATURES
2024-02-14Filter: Add support for setting TCP congestion control algorithmOndrej Zajicek
Allow to set TCP congestion control algorithm using krt_congctl route attribute. Based on patch from Trisha Biswas <tbiswas@fastly.com>, thanks!
2024-01-27Nest: Fix bug in recursive routes with MPLS-labeled nexthopsOndrej Zajicek
When a recursive route with MPLS-labeled nexthop was exported to kernel and read back, the nexthop_same() failed due to different labels_orig field and kernel protocol reinstalled it unnecessarily. For comparing hext hops, route cache has to distinguish ones with different labels_orig, but KRT has to ignore that, so we need two nexthop compare functions. Thanks to Marcel Menzel for the bugreport.
2023-12-13Log: Add support for UDP loggingOndrej Zajicek
Add support for UDP logging, using RFC 3164 syslog protocol. Based on the patch from Alexander Zubkov <green@qrator.net>, thanks!
2023-10-06NEWS and version updateOndrej Zajicek
2023-10-06KRT: Allow to learn routes with RTPROT_KERNELPavel Šorejs
The Kernel protocol, even with the option 'learn' enabled, ignores direct routes created by the OS kernel (on Linux these are routes with rtm_protocol == RTPROT_KERNEL). Implement optional behavior where both OS kernel and third-party routes are learned, it can be enabled by 'learn all' option. Minor changes by committer.
2023-10-04IO: Fix race condition in event processingOndrej Zajicek
When regular event was added from work event, we did remember that regular event list was empty and therefore we did not use zero time in poll(). This leads to ~3 s latency in route reload during reconfiguration.
2023-10-04MPLS subsystemOndrej Zajicek
The MPLS subsystem manages MPLS labels and handles their allocation to MPLS-aware routing protocols. These labels are then attached to IP or VPN routes representing label switched paths -- LSPs. There was already a preliminary MPLS support consisting of MPLS label net_addr, MPLS routing tables with static MPLS routes, remote labels in next hops, and kernel protocol support. This patch adds the MPLS domain as a basic structure representing local label space with dynamic label allocator and configurable label ranges. To represent LSPs, allocated local labels can be attached as route attributes to IP or VPN routes with local labels as attributes. There are several steps for handling LSP routes in routing protocols -- deciding to which forwarding equivalence class (FEC) the LSP route belongs, allocating labels for new FECs, announcing MPLS routes for new FECs, attaching labels to LSP routes. The FEC map structure implements basic code for managing FECs in routing protocols, therefore existing protocols can be made MPLS-aware by adding FEC map and delegating most work related to local label management to it.
2023-09-12Conf: Symbol manipulation gets its context explicitlyMaria Matejka
2023-09-12Conf: Adding dummy thread-number setting for easier sharing of configuration ↵Maria Matejka
between v2 and v3
2023-08-23Nest: Treat VRF interfaces as inside respective VRFsOndrej Zajicek
Despite not having defined 'master interface', VRF interfaces should be treated as being inside respective VRFs. They behave as a loopback for respective VRFs. Treating the VRF interface as inside the VRF allows e.g. OSPF to pick up IP addresses defined on the VRF interface. For this, we also need to tell apart VRF interfaces and regular interfaces. Extend Netlink code to parse interface type and mark VRF interfaces with IF_VRF flag. Based on the patch from Erin Shepherd, thanks!
2023-06-22Merge tag 'v2.13.1'Maria Matejka
2023-06-22NEWS and version updatev2.13.1Maria Matejka
2023-06-15Netlink: Allow RTA_VIA even without MPLS supportLuiz Amaral
It is necessary for IPv4 over IPv6 nexthop support on FreeBSD, and RTA_VIA is not really related to MPLS. It breaks build for some very old systems like Debian 8 and CentOS 7, but we generally do not support older kernels than 4.14 LTS anyway.
2023-06-02IO: Add current_time_now() function for immediate timestampToke Høiland-Jørgensen
Add a current_time_now() function which gets an immediate monotonic timestamp instead of using the cached value from the event loop. This is useful for callers that need precise times, such as the Babel RTT measurement code. Minor changes by committer.
2023-04-21NEWS and version updatev2.13Ondrej Zajicek
2023-04-21BSD: IPv4 over IPv6 nexthop support on FreeBSDLuiz Amaral
The support for IPv4 routes with IPv6 nexthops was implemented in FreeBSD 13.1, this patch allows to import and export such routes from/to kernel. Minor change from committer.
2023-03-06Net: Replace runtime checks with STATIC_ASSERT()Ondrej Zajicek
2023-01-23NEWS and version updatev2.0.12Ondrej Zajicek
2023-01-18Alloc: Minor cleanupsOndrej Zajicek
- Fix THP disable on old systems - Failed syscalls should use die() instead of bug() - Our printf uses %ld for s64 instead of long
2023-01-18Merge branch 'master' of https://gitlab.nic.cz/labs/birdMaria Matejka
2023-01-18Fix memory pre-allocationMaria Matejka
When BIRD has no free memory mapped, it allocates several pages in advance just to be sure that there is some memory available if needed. This hysteresis tactics works quite well to reduce memory ping-ping with kernel. Yet it had a subtle bug: this pre-allocation didn't take a memory coldlist into account, therefore requesting new pages from kernel even in cases when there were other pages available. This led to slow memory bloating. To demonstrate this behavior fast enough to be seen well, you may: * temporarily set the values in sysdep/unix/alloc.c as follows to exacerbate the issue: #define KEEP_PAGES_MAIN_MAX 4096 #define KEEP_PAGES_MAIN_MIN 1000 #define CLEANUP_PAGES_BULK 4096 * create a config file with several millions of static routes * periodically disable all static protocols and then reload config * log memory consumption This should give you a steady growth rate of about 16kB per cycle. If you don't set the values this high, the issue happens much more slowly, yet after 14 days of running, you are going to see an OOM kill. After this fix, pre-allocation uses the memory coldlist to get some hot pages and the same test as described here gets you a perfectly stable constant memory consumption (after some initial wobbling). Thanks to NIX-CZ for reporting and helping to investigate this issue. Thanks to Santiago for finding the cause in the code.
2023-01-17Alloc: Disable transparent huge pagesOndrej Zajicek
The usage pattern implemented in allocator seems to be incompatible with transparent huge pages, as memory released using madvise(MADV_DONTNEED) with regular page size and alignment does not seem to trigger demotion of huge pages back to regular pages, even when significant number of pages is released. Even if demotion is triggered when system memory is low, it still breaks memory accounting.
2023-01-13Minor cleanupsOndrej Zajicek
2023-01-13BSD: Add support for kernel route metricOndrej Zajicek
Add support for kernel route metric/priority, exported as krt_metric attribute, like in Linux. This should also fix issues with overwriting or removing system routes.
2023-01-12Log message before abortingMike Crute
Log message before aborting due to watchdog timeout. We have to use async-safe write to debug log, as it is done in signal handler. Minor changes from committer.
2022-12-18BSD: Use ip_mreqn on FreeBSD 12.1+ and OpenBSD 6.9+Ondrej Zajicek
2022-12-16FreeBSD: use interface index instead of IP address when specifying multicast ↵Alexander Chernikov
interface Minor changes from committer.
2022-12-16Netlink: move OS-specific headers and defines to sysdepAlexander Chernikov
Minor changes from committer.
2022-12-16BSD: Add missing makefile for bsd-netlink targetOndrej Zajicek
Use symlinks to linux/netlink* to avoid limitations of our buildsystem.
2022-12-11NEWS and version updatev2.0.11Ondrej Zajicek
2022-12-11BSD: Workaround for direct routes on FreeBSD 13.0Ondrej Zajicek
FreeBSD 13.0 added some safechecks for syscalls, rejecting sockaddrs that are too small, later versions loosen up the check.