From 1968b7eb219650e2beee57e6849b8fcf7ca325a5 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Tue, 14 Apr 2020 07:38:34 +0000 Subject: [PATCH] Postpone multipath seed init till SI_SUB_LAST, as it is needed only after some useland program installs multiple paths to the same destination. While here, make multipath init conditional. Discussed with: cem,ian --- sys/net/radix_mpath.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/net/radix_mpath.c b/sys/net/radix_mpath.c index 698ddbb516e..f8a9b7db3df 100644 --- a/sys/net/radix_mpath.c +++ b/sys/net/radix_mpath.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_mpath.h" #include #include @@ -298,11 +299,13 @@ rt_mpath_init_rnh(struct rib_head *rnh) rnh->rnh_multipath = 1; } +#ifdef RADIX_MPATH static void mpath_init(void) { hashjitter = arc4random(); } -SYSINIT(mpath_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, mpath_init, NULL); +SYSINIT(mpath_init, SI_SUB_LAST, SI_ORDER_ANY, mpath_init, NULL); +#endif