svn commit: r368128 - head/sys/net/route
Alexander V. Chernikov
melifaro at FreeBSD.org
Sat Nov 28 15:46:41 UTC 2020
Author: melifaro
Date: Sat Nov 28 15:46:40 2020
New Revision: 368128
URL: https://svnweb.freebsd.org/changeset/base/368128
Log:
Add nhgrp_get_idx() as a counterpart for nhop_get_idx().
It allows the routing-related code to reference nexthop groups by index
instead of storing a pointer.
Modified:
head/sys/net/route/nhgrp_ctl.c
head/sys/net/route/route_var.h
Modified: head/sys/net/route/nhgrp_ctl.c
==============================================================================
--- head/sys/net/route/nhgrp_ctl.c Sat Nov 28 15:11:59 2020 (r368127)
+++ head/sys/net/route/nhgrp_ctl.c Sat Nov 28 15:46:40 2020 (r368128)
@@ -753,6 +753,15 @@ dump_nhgrp_entry(struct rib_head *rh, const struct nhg
return (error);
}
+uint32_t
+nhgrp_get_idx(const struct nhgrp_object *nhg)
+{
+ const struct nhgrp_priv *nhg_priv;
+
+ nhg_priv = NHGRP_PRIV_CONST(nhg);
+ return (nhg_priv->nhg_idx);
+}
+
int
nhgrp_dump_sysctl(struct rib_head *rh, struct sysctl_req *w)
{
Modified: head/sys/net/route/route_var.h
==============================================================================
--- head/sys/net/route/route_var.h Sat Nov 28 15:11:59 2020 (r368127)
+++ head/sys/net/route/route_var.h Sat Nov 28 15:46:40 2020 (r368128)
@@ -305,6 +305,7 @@ int nhgrp_get_addition_group(struct rib_head *rnh,
struct route_nhop_data *rnd_orig, struct route_nhop_data *rnd_add,
struct route_nhop_data *rnd_new);
+uint32_t nhgrp_get_idx(const struct nhgrp_object *nhg);
void nhgrp_free(struct nhgrp_object *nhg);
/* Entropy data used for outbound hashing */
More information about the svn-src-all
mailing list