Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146629665
D27410.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27410.diff
View Options
Index: head/sys/net/route/nhgrp_ctl.c
===================================================================
--- head/sys/net/route/nhgrp_ctl.c
+++ head/sys/net/route/nhgrp_ctl.c
@@ -294,6 +294,17 @@
}
void
+nhgrp_ref_object(struct nhgrp_object *nhg)
+{
+ struct nhgrp_priv *nhg_priv;
+ u_int old;
+
+ nhg_priv = NHGRP_PRIV(nhg);
+ old = refcount_acquire(&nhg_priv->nhg_refcount);
+ KASSERT(old > 0, ("%s: nhgrp object %p has 0 refs", __func__, nhg));
+}
+
+void
nhgrp_free(struct nhgrp_object *nhg)
{
struct nhgrp_priv *nhg_priv;
Index: head/sys/net/route/nhop_ctl.c
===================================================================
--- head/sys/net/route/nhop_ctl.c
+++ head/sys/net/route/nhop_ctl.c
@@ -691,6 +691,19 @@
}
void
+nhop_ref_any(struct nhop_object *nh)
+{
+#ifdef ROUTE_MPATH
+ if (!NH_IS_NHGRP(nh))
+ nhop_ref_object(nh);
+ else
+ nhgrp_ref_object((struct nhgrp_object *)nh);
+#else
+ nhop_ref_object(nh);
+#endif
+}
+
+void
nhop_free_any(struct nhop_object *nh)
{
Index: head/sys/net/route/route_var.h
===================================================================
--- head/sys/net/route/route_var.h
+++ head/sys/net/route/route_var.h
@@ -242,6 +242,7 @@
void nhops_destroy_rib(struct rib_head *rh);
void nhop_ref_object(struct nhop_object *nh);
int nhop_try_ref_object(struct nhop_object *nh);
+void nhop_ref_any(struct nhop_object *nh);
void nhop_free_any(struct nhop_object *nh);
void nhop_set_type(struct nhop_object *nh, enum nhop_type nh_type);
@@ -306,6 +307,7 @@
struct route_nhop_data *rnd_orig, struct route_nhop_data *rnd_add,
struct route_nhop_data *rnd_new);
+void nhgrp_ref_object(struct nhgrp_object *nhg);
uint32_t nhgrp_get_idx(const struct nhgrp_object *nhg);
void nhgrp_free(struct nhgrp_object *nhg);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 5, 6:17 AM (21 m, 44 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29274373
Default Alt Text
D27410.diff (1 KB)
Attached To
Mode
D27410: Add nhop_ref_any(), referencing nhop or nexthop group.
Attached
Detach File
Event Timeline
Log In to Comment