Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146998212
D27406.id80095.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D27406.id80095.diff
View Options
Index: sys/net/route/route_ctl.h
===================================================================
--- sys/net/route/route_ctl.h
+++ sys/net/route/route_ctl.h
@@ -67,17 +67,19 @@
};
typedef int rib_walktree_f_t(struct rtentry *, void *);
typedef void rib_walk_hook_f_t(struct rib_head *rnh, enum rib_walk_hook stage,
- void *arg);
+ void *arg);
void rib_walk(uint32_t fibnum, int af, bool wlock, rib_walktree_f_t *wa_f,
- void *arg);
+ void *arg);
void rib_walk_ext(uint32_t fibnum, int af, bool wlock, rib_walktree_f_t *wa_f,
- rib_walk_hook_f_t *hook_f, void *arg);
+ rib_walk_hook_f_t *hook_f, void *arg);
+void rib_walk_ext_internal(struct rib_head *rnh, bool wlock,
+ rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg);
void rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f,
- void *arg, bool report);
+ void *arg, bool report);
void rib_foreach_table_walk(int family, bool wlock, rib_walktree_f_t *wa_f,
- rib_walk_hook_f_t *hook_f, void *arg);
+ rib_walk_hook_f_t *hook_f, void *arg);
void rib_foreach_table_walk_del(int family, rib_filter_f_t *filter_f, void *arg);
struct route_nhop_data;
Index: sys/net/route/route_helpers.c
===================================================================
--- sys/net/route/route_helpers.c
+++ sys/net/route/route_helpers.c
@@ -77,15 +77,11 @@
* Table is traversed under read lock unless @wlock is set.
*/
void
-rib_walk_ext(uint32_t fibnum, int family, bool wlock, rib_walktree_f_t *wa_f,
+rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f,
rib_walk_hook_f_t *hook_f, void *arg)
{
RIB_RLOCK_TRACKER;
- struct rib_head *rnh;
- if ((rnh = rt_tables_get_rnh(fibnum, family)) == NULL)
- return;
-
if (wlock)
RIB_WLOCK(rnh);
else
@@ -99,6 +95,16 @@
RIB_WUNLOCK(rnh);
else
RIB_RUNLOCK(rnh);
+}
+
+void
+rib_walk_ext(uint32_t fibnum, int family, bool wlock, rib_walktree_f_t *wa_f,
+ rib_walk_hook_f_t *hook_f, void *arg)
+{
+ struct rib_head *rnh;
+
+ if ((rnh = rt_tables_get_rnh(fibnum, family)) != NULL)
+ rib_walk_ext_internal(rnh, wlock, wa_f, hook_f, arg);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 8, 11:11 AM (9 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29404055
Default Alt Text
D27406.id80095.diff (2 KB)
Attached To
Mode
D27406: Introduce rib_walk_ext_internal() to allow specifying rib by rnh pointer directly.
Attached
Detach File
Event Timeline
Log In to Comment