aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2020-06-01 20:32:02 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2020-06-01 20:32:02 +0000
commit79674562b8883beff69f81cc9163044f8c029474 (patch)
tree2387c551ef282fa5023096d5eac13cfeb7d2ee22 /sys/netinet6
parent30dc2aebd7e88d43d620bba765edd21fcd20f3be (diff)
downloadsrc-79674562b8883beff69f81cc9163044f8c029474.tar.gz
src-79674562b8883beff69f81cc9163044f8c029474.zip
* Add rib_<add|del|change>_route() functions to manipulate the routing table.
The main driver for the change is the need to improve notification mechanism. Currently callers guess the operation data based on the rtentry structure returned in case of successful operation result. There are two problems with this appoach. First is that it doesn't provide enough information for the upcoming multipath changes, where rtentry refers to a new nexthop group, and there is no way of guessing which paths were added during the change. Second is that some rtentry fields can change during notification and protecting from it by requiring customers to unlock rtentry is not desired. Additionally, as the consumers such as rtsock do know which operation they request in advance, making explicit add/change/del versions of the functions makes sense, especially given the functions don't share a lot of code. With that in mind, introduce rib_cmd_info notification structure and rib_<add|del|change>_route() functions, with mandatory rib_cmd_info pointer. It will be used in upcoming generalized notifications. * Move definitions of the new functions and some other functions/structures used for the routing table manipulation to a separate header file, net/route/route_ctl.h. net/route.h is a frequently used file included in ~140 places in kernel, and 90% of the users don't need these definitions. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D25067
Notes
Notes: svn path=/head/; revision=361704
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/icmp6.c1
-rw-r--r--sys/netinet6/in6_rmx.c1
-rw-r--r--sys/netinet6/nd6_rtr.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 1fac329a9cec..597fb9d5de27 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_llatbl.h>
#include <net/if_types.h>
#include <net/route.h>
+#include <net/route/route_ctl.h>
#include <net/route/nhop.h>
#include <net/vnet.h>
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index ce74aee0c231..54cf0dcb23c2 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_var.h>
#include <net/route.h>
+#include <net/route/route_ctl.h>
#include <net/route/route_var.h>
#include <net/route/nhop.h>
#include <net/route/shared.h>
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 98cc1b220248..023fbb0e4175 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_dl.h>
#include <net/route.h>
#include <net/route/nhop.h>
+#include <net/route/route_ctl.h>
#include <net/route/route_var.h>
#include <net/radix.h>
#include <net/vnet.h>