diff options
author | qingli <qingli@FreeBSD.org> | 2008-04-13 05:45:14 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2008-04-13 05:45:14 +0000 |
commit | 4e8901ea7a04d2d803067647c0641e41494b8868 (patch) | |
tree | 03815f4a4313c90b705a6c025d169df0eddd29c1 /sys/netinet6/in6_proto.c | |
parent | 5a49f99cf6d02cec123b5d9a859677c5ab42a0b3 (diff) | |
download | FreeBSD-src-4e8901ea7a04d2d803067647c0641e41494b8868.zip FreeBSD-src-4e8901ea7a04d2d803067647c0641e41494b8868.tar.gz |
This patch provides the back end support for equal-cost multi-path
(ECMP) for both IPv4 and IPv6. Previously, multipath route insertion
is disallowed. For example,
route add -net 192.103.54.0/24 10.9.44.1
route add -net 192.103.54.0/24 10.9.44.2
The second route insertion will trigger an error message of
"add net 192.103.54.0/24: gateway 10.2.5.2: route already in table"
Multiple default routes can also be inserted. Here is the netstat
output:
default 10.2.5.1 UGS 0 3074 bge0 =>
default 10.2.5.2 UGS 0 0 bge0
When multipath routes exist, the "route delete" command requires
a specific gateway to be specified or else an error message would
be displayed. For example,
route delete default
would fail and trigger the following error message:
"route: writing to routing socket: No such process"
"delete net default: not in table"
On the other hand,
route delete default 10.2.5.2
would be successful: "delete net default: gateway 10.2.5.2"
One does not have to specify a gateway if there is only a single
route for a particular destination.
I need to perform more testings on address aliases and multiple
interfaces that have the same IP prefixes. This patch as it
stands today is not yet ready for prime time. Therefore, the ECMP
code fragments are fully guarded by the RADIX_MPATH macro.
Include the "options RADIX_MPATH" in the kernel configuration
to enable this feature.
Reviewed by: robert, sam, gnn, julian, kmacy
Diffstat (limited to 'sys/netinet6/in6_proto.c')
-rw-r--r-- | sys/netinet6/in6_proto.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 7e6a75e..9cf8091 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipstealth.h" #include "opt_carp.h" #include "opt_sctp.h" +#include "opt_mpath.h" #include <sys/param.h> #include <sys/socket.h> @@ -83,6 +84,9 @@ __FBSDID("$FreeBSD$"); #include <net/if.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> @@ -347,7 +351,11 @@ struct domain inet6domain = { .dom_protosw = (struct protosw *)inet6sw, .dom_protoswNPROTOSW = (struct protosw *) &inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], +#ifdef RADIX_MPATH + .dom_rtattach = rn6_mpath_inithead, +#else .dom_rtattach = in6_inithead, +#endif .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, |