summaryrefslogtreecommitdiff
path: root/sysdep/bsd/krt-sock.c
AgeCommit message (Collapse)Author
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-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-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-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.
2016-05-10Merge branch 'int-new' into int-new-mergedJan Moskyto Matejka
2016-05-10Build system reworked to one global Makefile with includes and no nestingJan Moskyto Matejka
Also removed the lib-dir merging with sysdep. Updated #include's accordingly. Fixed make doc on recent Debian together with moving generated doc into objdir. Moved Makefile.in into root dir Retired all.o and birdlib.a Linking the final binaries directly from all the .o files.
2016-04-08Merge branch 'master' into int-new-channelsJan Moskyto Matejka
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-02-01BSD: compilation error fixJan Moskyto Matejka
2016-01-21BSD: Explicitly dropping routes with mismatched AF's.Jan Moskyto Matejka
2016-01-20BSD integration fixesJan Moskyto Matejka
2015-12-21Follow-up work on integrationOndrej Zajicek (work)
Contains some patches from Jan Moskyto Matejka
2015-12-19Removed BITS_PER_IP_ADDRESS, MAX_PREFIX_LENGTH, BIRD_AFJan Moskyto Matejka
Explicit setting of AF_INET(6|) in IP socket creation. BFD set to listen on v6, without setting the V6ONLY flag to catch both v4 and v6 traffic. Squashing and minor changes by Ondrej Santiago Zajicek
2015-12-18Netlink and BSD: Integrating IPv4 and IPv6Jan Moskyto Matejka
Squashing and minor changes by Ondrej Santiago Zajicek
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-06-08unsigned [int] -> uintPavel Tvrdík
2015-04-22KRT: Support for RTM_CHANGE on BSDOndrej Zajicek
2015-04-12Minor fixesOndrej Zajicek
2014-10-24Integrated IP functions.Ondrej Zajicek
2014-07-09Fixes a bug in BSD kernel interfacing code.Ondrej Zajicek
The bug was introduced in 05476c4d04a24bdb26fa64e05ab31bc36118f34e.
2014-05-18IPv4/IPv6 integrated socket code.Ondrej Zajicek
2014-02-26Fixes longstanding issue with interfaces staying in IF_TMP_DOWN.Ondrej Zajicek
Thanks to Pierluigi Rolando and others for the bugreport.
2013-11-25Merge branch 'master' into add-pathOndrej Zajicek
2013-11-25Changes primary addr selection on BSD to respect SIOCGIFADDR ioctl() result.Ondrej Zajicek
Thanks to Alexander V. Chernikov for the original patch.