summaryrefslogtreecommitdiff
path: root/sysdep/bsd/krt-sock.c
AgeCommit message (Collapse)Author
2023-04-24Merge commit 'd61505b039bf0aa6697e28b2a4e07907c89ba1fb' into thread-nextMaria Matejka
2023-04-22Socket closing has its dedicated functionMaria Matejka
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-04-04Sockets: Unified API for main and other loopsMaria Matejka
Now sk_open() requires an explicit IO loop to open the socket in. Also specific functions for socket RX pause / resume are added to allow for BGP corking. And last but not least, socket reloop is now synchronous to resolve weird cases of the target loop stopping before actually picking up the relooped socket. Now the caller must ensure that both loops are locked while relooping, and this way all sockets always have their respective loop.
2023-04-04Interface subsystem lockingMaria Matejka
2023-01-23Merge commit '928a1cb034e6f9e8edcdd1dc07264cd703e00827' into thread-nextMaria Matejka
2023-01-23Merge commit '7fb23041a52d01754c53ba963e2282e524813364' into thread-nextMaria Matejka
2023-01-21Merge commit '1e47b9f203aaaad0fb658d40a1670f1d0437f1f8' into thread-nextMaria Matejka
2023-01-20Fixed various build problems on FreeBSD and/or CLangMaria Matejka
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.
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.
2022-11-30BSD: Fix krt socket code w.r.t. rte/rta changesOndrej Zajicek
2022-05-30Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesundMaria Matejka
2022-05-30Merge commit '702c04fbef222e802ca4dfac645dc75ede522db6' into haugesundMaria Matejka
2022-05-30Merge commit 'cf07d8ad79273a3bbf0617c17e438602e4b64ece' into haugesundMaria Matejka
2022-05-30Merge commit 'ef6a903e6f44b467f9606018446095521ad01ef1' into haugesundMaria Matejka
2022-05-30Merge commit '0d0f6554a5c233bf2bf830ae319191c4b1808d49' into haugesundMaria Matejka
2022-05-04Moved route source attribute (RTS_*) to eattrsMaria Matejka
2022-05-04Removing the route scope attribute. Use custom attributes instead.Maria Matejka
The route scope attribute was used for simple user route marking. As there is a better tool for this (custom attributes), the old and limited way can be dropped.
2022-05-04Replaced boilerplate eattr allocation by ea_set_attr()Maria Matejka
2022-05-04Splitting route data structures out to libMaria Matejka
2022-05-04Unified attribute and filter typesMaria Matejka
This commit removes the EAF_TYPE_* namespace completely and also for route attributes, filter-based types T_* are used. This simplifies fetching and setting route attributes from filters. Also, there is now union bval which serves as an universal value holder instead of private unions held separately by eattr and filter code.
2022-03-09Merge commit '1b9189d5' into haugesundMaria Matejka
2022-03-09Merge commit 'e42eedb9' into haugesundMaria Matejka
2021-12-27BSD: Assume onlink flag on ifaces with only host addressesOndrej Zajicek (work)
The BSD kernel does not support the onlink flag and BIRD does not use direct routes for next hop validation, instead depends on interface address ranges. We would like to handle PtMP cases with only host addresses configured, like: ifconfig wg0 192.168.0.10/32 route add 192.168.0.4 -iface wg0 route add 192.168.0.8 -iface wg0 To accept BIRD routes with onlink next-hop, like: route 192.168.42.0/24 via 192.168.0.4%wg0 onlink BIRD would dismiss the route when receiving from the kernel, as the next-hop 192.168.0.4 is not part of any interface subnet and onlink flag is not kept by the BSD kernel. The commit fixes this by assuming that for routes received from the kernel, any next-hop is onlink on ifaces with only host addresses. Thanks to Stefan Haller for the original patch.
2021-11-09Split route data structure to storage (ro) / manipulation (rw) structures.Maria Matejka
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.
2021-10-13Kernel: Convert the rte-local attributes to extended attributes and flags to ↵Maria Matejka
pflags
2021-05-10BSD: Propagate OS-level IFF_MULTICAST to internal IF_MULTICAST flagToke Høiland-Jørgensen
The BSD code did not propagate the OS-level IFF_MULTICAST flag to the Bird-internal IF_MULTICAST flag, which causes problems with Wireguard interfaces on FreeBSD. The Linux sysdep code does propagate the flag already, so just copy over the same check and flag update.
2021-04-19BSD: Fix invalid pointer derefence in logging codeStefan Haller
For logging purposes a stack allocated net_addr struct was passed by value as vararg (instead of the expected pointer). This resulted in a segfault when the specific error condition got logged.
2019-12-19KRT: Remove KRF_SYNC_ERROR flagOndrej Zajicek (work)
This info is now stored in an internal bmap. Unfortunately, net.flags is still needed for temporary kernel data.
2018-06-27BSD: Fix of the previous commitOndrej Zajicek (work)
2018-05-30Nest: Removing separate tmpa from route propagationJan Maria Matejka
This is a fundamental change of an original (1999) concept of route processing inside BIRD. During import/export, there was a temporary ea_list created which was to be used instead of the another one inside the route itself. This led to some confusion, quirks, and strange filter code that handled extended route attributes. Dropping it now. The protocol interface has changed in an uniform way -- the `struct ea_list *attrs` argument has been removed from store_tmp_attrs(), import_control(), rt_notify() and get_route_info().
2018-01-14KRT: Fix direct routes for BSDOndrej Zajicek (work)
Old way to set direct routes is to use local IP as gateway, but that does not work properly on newer FreeBSDs. Now we use sockaddr_dl containing interface index as gateway.
2017-12-12Fix some minor issuesOndrej Zajicek (work)
2017-12-08Enable ECMP and Link detection by defaultOndrej Zajicek (work)
ECMP is not enabled on BSD, where it is not supported by BIRD.
2017-12-07Merge commit '98bb80a243b58c43453e9be69d19d0350286549c' into int-newOndrej Zajicek (work)
2017-12-07BSD: Fix in the last commitOndrej Zajicek (work)
2017-12-07BSD: Minor fix of penultimate commitOndrej Zajicek (work)
2017-12-07Nest: Maintain separate IPv4, IPv6 and LLv6 preferred addressesOndrej Zajicek (work)
Also redesign preferred address selection and update protocols to use appropriate preferred address. Based on a previous work by Jan Maria Matejka.
2017-09-04BSD: Fix alignment issueOndrej Zajicek (work)
Incorrect structure alignment breaks kernel routing table updates on FreeBSD/ARM (and perhaps other platforms). Thanks to Eugene Sevastyanov for the original patch.
2017-04-29BSD: Fix address scan on OpenBSDOndrej Zajicek (work)
2017-04-29Minor fixesOndrej Zajicek (work)
2017-02-20Several minor fixesOndrej Zajicek (work)
2016-12-22Removing (struct rta)->cast. Never used.Jan Moskyto Matejka
2016-12-22Merged multipath and single-path data structures.Jan Moskyto Matejka
Dropped struct mpnh and mpnh_*() Now struct nexthop exists, nexthop_*(), and also included struct nexthop into struct rta. Also converted RTD_DEVICE and RTD_ROUTER to RTD_UNICAST. If it is needed to distinguish between these two cases, RTD_DEVICE is equivalent to IPA_ZERO(a->nh.gw), RTD_ROUTER is then IPA_NONZERO(a->nh.gw). From now on, we also explicitely want C99 compatible compiler. We assume that this 20-year norm should be known almost everywhere.
2016-11-08Merge branch 'master' into int-newOndrej Zajicek (work)
2016-11-08Merge tag 'v1.6.2' into int-newOndrej 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-09-29Kernel socket missing err_hook fixJan Moskyto Matejka
Thanks to Tim Weippert for bugreport.