#
1da4954c |
| 13-Nov-2024 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
Fix failure to add an interface prefix route when route with the same prefix is already presented in the routing table.
PR: 277125 Reported by: Oleksandr Ignatyev <alex@i.org.ua> Reviewed by: ae,
Fix failure to add an interface prefix route when route with the same prefix is already presented in the routing table.
PR: 277125 Reported by: Oleksandr Ignatyev <alex@i.org.ua> Reviewed by: ae, jlduran Tested by: jlduran Differential Revision: https://reviews.freebsd.org/D47534 MFC after: 2 weeks
show more ...
|
Revision tags: release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
95ee2897 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
#
34066d00 |
| 25-Apr-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add iterator-based nhop traversal KPI.
MFC after: 2 weeks
|
#
fd1aa866 |
| 25-Apr-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add rt_tables_get_rnh_safe() that doesn't panic when af/fib is incorrect.
MFC after: 2 weeks
|
Revision tags: release/13.2.0 |
|
#
c35a43b2 |
| 02-Apr-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: allow exact-match route lookups via RTM_GETROUTE.
Use already-existing RTM_F_PREFIX rtm_flag to indicate that the request assumes exact-prefix lookup instead of the longest-prefix-match.
netlink: allow exact-match route lookups via RTM_GETROUTE.
Use already-existing RTM_F_PREFIX rtm_flag to indicate that the request assumes exact-prefix lookup instead of the longest-prefix-match.
MFC after: 2 weeks
show more ...
|
#
2cda6a2f |
| 26-Mar-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add public rt_is_exportable() version to check if the route can be exported to userland when jailed.
Differential Revision: https://reviews.freebsd.org/D39204 MFC after: 2 weeks
|
#
1bcd230f |
| 03-Dec-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: add interface notification on link status / flags change.
* Add link-state change notifications by subscribing to ifnet_link_event. In the Linux netlink model, link state is reported in 2
netlink: add interface notification on link status / flags change.
* Add link-state change notifications by subscribing to ifnet_link_event. In the Linux netlink model, link state is reported in 2 places: first is the IFLA_OPERSTATE, which stores state per RFC2863. The second is an IFF_LOWER_UP interface flag. As many applications rely on the latter, reserve 1 bit from if_flags, named as IFF_NETLINK_1. This flag is mapped to IFF_LOWER_UP in the netlink headers. This is done to avoid making applications think this flag is actually supported / presented in non-netlink outputs. * Add flag change notifications, by hooking into rt_ifmsg(). In the netlink model, notification should include the bitmask for the change flags. Update rt_ifmsg() to include such bitmask.
Differential Revision: https://reviews.freebsd.org/D37597
show more ...
|
Revision tags: release/12.4.0, release/13.1.0 |
|
#
7e5bf684 |
| 20-Jan-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: add netlink support
Netlinks is a communication protocol currently used in Linux kernel to modify, read and subscribe for nearly all networking state. Interfaces, addresses, routes, firew
netlink: add netlink support
Netlinks is a communication protocol currently used in Linux kernel to modify, read and subscribe for nearly all networking state. Interfaces, addresses, routes, firewall, fibs, vnets, etc are controlled via netlink. It is async, TLV-based protocol, providing 1-1 and 1-many communications.
The current implementation supports the subset of NETLINK_ROUTE family. To be more specific, the following is supported: * Dumps: - routes - nexthops / nexthop groups - interfaces - interface addresses - neighbors (arp/ndp) * Notifications: - interface arrival/departure - interface address arrival/departure - route addition/deletion * Modifications: - adding/deleting routes - adding/deleting nexthops/nexthops groups - adding/deleting neghbors - adding/deleting interfaces (basic support only) * Rtsock interaction - route events are bridged both ways
The implementation also supports the NETLINK_GENERIC family framework.
Implementation notes: Netlink is implemented via loadable/unloadable kernel module, not touching many kernel parts. Each netlink socket uses dedicated taskqueue to support async operations that can sleep, such as interface creation. All message processing is performed within these taskqueues.
Compatibility: Most of the Netlink data models specified above maps to FreeBSD concepts nicely. Unmodified ip(8) binary correctly works with interfaces, addresses, routes, nexthops and nexthop groups. Some software such as net/bird require header-only modifications to compile and work with FreeBSD netlink.
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36002 MFC after: 2 months
show more ...
|
#
177f04d5 |
| 29-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: constantify @rc in rib_decompose_notification().
Clarify the @rc immutability by explicitly marking @rc const.
MFC after: 2 weeks
|
#
7b3440fc |
| 29-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
Revert "routing: install prefix and loopback routes using new nhop-based KPI."
Temporarily revert the commit to unblock testing.
This reverts commit a1b59379db7d879551118b921f6e9692b4bf200c.
|
#
fe05d1dd |
| 29-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: extend nhop(9) kpi
* add nhop_get_unlinked() used to prepare referenced but not linked nexthop, that can later be used as a clone source. * add nhop_check_gateway() to check for allowed ad
routing: extend nhop(9) kpi
* add nhop_get_unlinked() used to prepare referenced but not linked nexthop, that can later be used as a clone source. * add nhop_check_gateway() to check for allowed address family combinations between the rib family and neighbor family (useful for 4o6 or direct routes) * add nhop_set_upper_family() to allow copying IPv6 nexthops to IPv4 rib. * add rt_get_rnd() wrapper, returning both nexthop/group and its weight attached to the rtentry. * Add CHT_SLIST_FOREACH_SAFE(), allowing to delete items during iteration.
MFC after: 2 weeks
show more ...
|
#
db4ca190 |
| 29-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add ability to store opaque indentifiers in nhops/nhgs
This is a pre-requisite for the direct nexthop/nexhop group operations via netlink.
MFC after: 2 weeks
|
#
d8b26934 |
| 09-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add rib_add_default_route() wrapper
Multiple consumers in the kernel space want to install IPv4 or IPv6 default route. Provide convenient wrapper to simplify the code inside the customers
routing: add rib_add_default_route() wrapper
Multiple consumers in the kernel space want to install IPv4 or IPv6 default route. Provide convenient wrapper to simplify the code inside the customers.
MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D36167
show more ...
|
#
a1b59379 |
| 08-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: install prefix and loopback routes using new nhop-based KPI.
Construct the desired hexthops directly instead of using the "translation" layer in form of filling rt_addrinfo data. Simplify
routing: install prefix and loopback routes using new nhop-based KPI.
Construct the desired hexthops directly instead of using the "translation" layer in form of filling rt_addrinfo data. Simplify V_rt_add_addr_allfibs handling by using recently-added rib_copy_route() to propagate the routes to the non-primary address fibs.
MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D36166
show more ...
|
#
730bfa28 |
| 12-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add rib_match_gw() helper
Finish 02e05b8faec1: * add gateway matcher function that can be used in rib_del_route_px() or any rib_walk-family functions. It will be used in the upcoming migr
routing: add rib_match_gw() helper
Finish 02e05b8faec1: * add gateway matcher function that can be used in rib_del_route_px() or any rib_walk-family functions. It will be used in the upcoming migration to the new KPI * rename gw_fulter_func to match_gw_one() to better signal the function purpose / semantic.
MFC after: 1 month
show more ...
|
#
02e05b8f |
| 11-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: fixup empty mask prefix handling after 2ce553854cbd.
MFC after: 1 month
|
#
5c4d2252 |
| 08-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: move rtentry and subscription code out of route_ctl.c
route_ctl.c size has grown considerably since initial introduction. Factor out non-relevant parts: * all rtentry logic, such as creatio
routing: move rtentry and subscription code out of route_ctl.c
route_ctl.c size has grown considerably since initial introduction. Factor out non-relevant parts: * all rtentry logic, such as creation/destruction and accessors goes to net/route/route_rtentry.c * all rtable subscription logic goes to net/route/route_subscription.c
Differential Revision: https://reviews.freebsd.org/D36074 MFC after: 1 month
show more ...
|
#
2ce55385 |
| 04-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: add rib_<add|del>_route_px() functions operating with nexthops.
This change adds public KPI to work with routes using pre-created nexthops, instead of using data from addrinfo structures.
routing: add rib_<add|del>_route_px() functions operating with nexthops.
This change adds public KPI to work with routes using pre-created nexthops, instead of using data from addrinfo structures. These functions will be later used for adding/deleting kernel-originated routes and upcoming netlink protocol.
As a part of providing this KPI, low-level route addition code has been reworked to provide more control over route creation or change. Specifically, a number of operation flags (RTM_F_<CREATE|EXCL|REPLACE|APPEND>) have been added, defining the desired behaviour the the route already exists (or not exists). This change required some changes in the multipath addition code, resulting in moving this code to route_ctl.c, rendering mpath_ctl.c empty.
Differential Revision: https://reviews.freebsd.org/D36073 MFC after: 1 month
show more ...
|
#
dedeec11 |
| 03-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: refactor #2
* Use same filter func (rib_filter_f_t) for nexhtop groups to simplify callbacks. * simplify conditional route deletion & remove the need to pass rt_addrinfo to the low-level
routing: refactor #2
* Use same filter func (rib_filter_f_t) for nexhtop groups to simplify callbacks. * simplify conditional route deletion & remove the need to pass rt_addrinfo to the low-level deletion functions * speedup rib_walk_del() by removing an additional per-prefix lookup
Differential Revision: https://reviews.freebsd.org/D36071 MFC after: 1 month
show more ...
|
#
ae6bfd12 |
| 01-Aug-2022 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: refactor private KPI * Make nhgrp_get_nhops() return const struct weightened_nhop to indicate that the list is immutable * Make nhgrp_get_group() return the actual group, instead of group+
routing: refactor private KPI * Make nhgrp_get_nhops() return const struct weightened_nhop to indicate that the list is immutable * Make nhgrp_get_group() return the actual group, instead of group+weight.
MFC after: 2 weeks
show more ...
|
Revision tags: release/12.3.0 |
|
#
36e15b71 |
| 16-Aug-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
routing: Fix crashes with dpdk_lpm[46] algo.
When a prefix gets deleted from the RIB, dpdk_lpm algo needs to know the nexthop of the "parent" prefix to update its internal state. The glue code, whi
routing: Fix crashes with dpdk_lpm[46] algo.
When a prefix gets deleted from the RIB, dpdk_lpm algo needs to know the nexthop of the "parent" prefix to update its internal state. The glue code, which utilises RIB as a backing route store, uses fib[46]_lookup_rt() for the prefix destination after its deletion to fetch the desired nexthop. This approach does not work when deleting less-specific prefixes with most-specific ones are still present. For example, if 10.0.0.0/24, 10.0.0.0/23 and 10.0.0.0/22 exist in RIB, deleting 10.0.0.0/23 would result in 10.0.0.0/24 being returned as a search result instead of 10.0.0.0/22. This, in turn, results in the failed datastructure update: part of the deleted /23 prefix will still contain the reference to an old nexthop. This leads to the use-after-free behaviour, ending with the eventual crashes.
Fix the logic flaw by properly fetching the prefix "parent" via newly-created rt_get_inet[6]_parent() helpers.
Differential Revision: https://reviews.freebsd.org/D31546 PR: 256882,256833 MFC after: 1 week
show more ...
|
#
5b42b494 |
| 01-Aug-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
Fix typo in rib_unsibscribe<_locked>().
Submitted by: Zhenlei Huang<zlei.huang at gmail.com> Differential Revision: https://reviews.freebsd.org/D31356
|
#
f9668e42 |
| 25-Apr-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
Add rib_walk_from() wrapper for selective rib tree traversal.
Provide wrapper for the rnh_walktree_from() rib callback. As currently `struct rib_head` is considered internal to the routing subsyste
Add rib_walk_from() wrapper for selective rib tree traversal.
Provide wrapper for the rnh_walktree_from() rib callback. As currently `struct rib_head` is considered internal to the routing subsystem, this wrapper is necessary to maintain isolation from the external code.
Differential Revision: https://reviews.freebsd.org/D29971 MFC after: 1 week
show more ...
|
Revision tags: release/13.0.0 |
|
#
151ec796 |
| 30-Jan-2021 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
Fix the design problem with delayed algorithm sync.
Currently, if the immutable algorithm like bsearch or radix_lockless receives rtable update notification, it schedules algorithm rebuild. This re
Fix the design problem with delayed algorithm sync.
Currently, if the immutable algorithm like bsearch or radix_lockless receives rtable update notification, it schedules algorithm rebuild. This rebuild is executed by the callout after ~50 milliseconds.
It is possible that a script adding an interface address and than route with the gateway bound to that address will fail. It can happen due to the fact that fib is not updated by the time the route addition request arrives.
Fix this by allowing synchronous algorithm rebuilds based on certain conditions. By default, these conditions assume: 1) less than net.route.algo.fib_sync_limit=100 routes 2) routes without gateway.
* Move algo instance build entirely under rib WLOCK. Rib lock is only used for control plane (except radix algo, but there are no rebuilds). * Add rib_walk_ext_locked() function to allow RIB iteration with rib lock already held. * Fix rare potential callout use-after-free for fds by binding fd callout to the relevant rib rmlock. In that case, callout_stop() under rib WLOCK guarantees no callout will be executed afterwards.
MFC after: 3 days
show more ...
|