Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157194825
D24356.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D24356.id.diff
View Options
Index: head/sys/net/radix_mpath.c
===================================================================
--- head/sys/net/radix_mpath.c
+++ head/sys/net/radix_mpath.c
@@ -290,38 +290,18 @@
RT_UNLOCK(ro->ro_rt);
}
-extern int in6_inithead(void **head, int off, u_int fibnum);
-extern int in_inithead(void **head, int off, u_int fibnum);
-
-#ifdef INET
-int
-rn4_mpath_inithead(void **head, int off, u_int fibnum)
+void
+rt_mpath_init_rnh(struct rib_head *rnh)
{
- struct rib_head *rnh;
- hashjitter = arc4random();
- if (in_inithead(head, off, fibnum) == 1) {
- rnh = (struct rib_head *)*head;
- rnh->rnh_multipath = 1;
- return 1;
- } else
- return 0;
+ rnh->rnh_multipath = 1;
}
-#endif
-#ifdef INET6
-int
-rn6_mpath_inithead(void **head, int off, u_int fibnum)
+static void
+mpath_init(void)
{
- struct rib_head *rnh;
hashjitter = arc4random();
- if (in6_inithead(head, off, fibnum) == 1) {
- rnh = (struct rib_head *)*head;
- rnh->rnh_multipath = 1;
- return 1;
- } else
- return 0;
}
+SYSINIT(mpath_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, mpath_init, NULL);
-#endif
Index: head/sys/net/route_var.h
===================================================================
--- head/sys/net/route_var.h
+++ head/sys/net/route_var.h
@@ -88,6 +88,7 @@
"ro_dst and " #_dst_new " are at different offset")
struct rib_head *rt_tables_get_rnh(int fib, int family);
+void rt_mpath_init_rnh(struct rib_head *rnh);
/* rte<>nhop translation */
static inline uint16_t
Index: head/sys/netinet/in_proto.c
===================================================================
--- head/sys/netinet/in_proto.c
+++ head/sys/netinet/in_proto.c
@@ -62,9 +62,6 @@
#include <net/if.h>
#include <net/if_var.h>
#include <net/route.h>
-#ifdef RADIX_MPATH
-#include <net/radix_mpath.h>
-#endif
#include <net/vnet.h>
#endif /* INET */
@@ -305,11 +302,7 @@
.dom_name = "internet",
.dom_protosw = inetsw,
.dom_protoswNPROTOSW = &inetsw[nitems(inetsw)],
-#ifdef RADIX_MPATH
- .dom_rtattach = rn4_mpath_inithead,
-#else
.dom_rtattach = in_inithead,
-#endif
#ifdef VIMAGE
.dom_rtdetach = in_detachhead,
#endif
Index: head/sys/netinet/in_rmx.c
===================================================================
--- head/sys/netinet/in_rmx.c
+++ head/sys/netinet/in_rmx.c
@@ -30,6 +30,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_mpath.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -125,6 +127,9 @@
return (0);
rh->rnh_addaddr = in_addroute;
+#ifdef RADIX_MPATH
+ rt_mpath_init_rnh(rh);
+#endif
*head = (void *)rh;
if (_in_rt_was_here == 0 ) {
Index: head/sys/netinet6/in6_proto.c
===================================================================
--- head/sys/netinet6/in6_proto.c
+++ head/sys/netinet6/in6_proto.c
@@ -90,9 +90,6 @@
#include <net/if_var.h>
#include <net/radix.h>
#include <net/route.h>
-#ifdef RADIX_MPATH
-#include <net/radix_mpath.h>
-#endif
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -346,11 +343,7 @@
.dom_name = "internet6",
.dom_protosw = (struct protosw *)inet6sw,
.dom_protoswNPROTOSW = (struct protosw *)&inet6sw[nitems(inet6sw)],
-#ifdef RADIX_MPATH
- .dom_rtattach = rn6_mpath_inithead,
-#else
.dom_rtattach = in6_inithead,
-#endif
#ifdef VIMAGE
.dom_rtdetach = in6_detachhead,
#endif
Index: head/sys/netinet6/in6_rmx.c
===================================================================
--- head/sys/netinet6/in6_rmx.c
+++ head/sys/netinet6/in6_rmx.c
@@ -64,6 +64,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_mpath.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -167,6 +169,9 @@
return (0);
rh->rnh_addaddr = in6_addroute;
+#ifdef RADIX_MPATH
+ rt_mpath_init_rnh(rh);
+#endif
*head = (void *)rh;
return (1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 20, 5:33 AM (12 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33337911
Default Alt Text
D24356.id.diff (3 KB)
Attached To
Mode
D24356: Remove custom radix_mpath initialization.
Attached
Detach File
Event Timeline
Log In to Comment