diff options
author | bz <bz@FreeBSD.org> | 2012-02-17 02:39:58 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2012-02-17 02:39:58 +0000 |
commit | dcdb23291fec1365e927195511d5dfb273901a5d (patch) | |
tree | c7ee398c979933c1e0e6d10495989fe027210cec /etc | |
parent | f73705f023ce445780ef6da3c298f9aca1ef8acb (diff) | |
download | FreeBSD-src-dcdb23291fec1365e927195511d5dfb273901a5d.zip FreeBSD-src-dcdb23291fec1365e927195511d5dfb273901a5d.tar.gz |
Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:
Extend the so far IPv4-only support for multiple routing tables (FIBs)
introduced in r178888 to IPv6 providing feature parity.
This includes an extended rtalloc(9) KPI for IPv6, the necessary
adjustments to the network stack, and user land support as in netstat.
Sponsored by: Cisco Systems, Inc.
Reviewed by: melifaro (basically)
MFC after: 10 days
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.d/routing | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/etc/rc.d/routing b/etc/rc.d/routing index ec90e8d..5903acc 100755 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -139,12 +139,22 @@ static_inet() static_inet6() { - local _action i + local _action i fibs _action=$1 + # get the number of FIBs supported. + fibs=`sysctl -n net.fibs` + : ${fibs:=1} + # disallow "internal" addresses to appear on the wire - route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject - route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=0 + while test ${i} -lt ${fibs}; do + setfib -F ${i} route ${_action} \ + -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + setfib -F ${i} route ${_action} \ + -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=$((i + 1)) + done case ${ipv6_defaultrouter} in [Nn][Oo] | '') @@ -216,8 +226,14 @@ static_inet6() # for the host case, you will allow to omit the identifiers. # Under this configuration, the packets will go to the default # interface. - route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject - route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject + i=0 + while test ${i} -lt ${fibs}; do + setfib -F ${i} route ${_action} \ + -inet6 fe80:: -prefixlen 10 ::1 -reject + setfib -F ${i} route ${_action} \ + -inet6 ff02:: -prefixlen 16 ::1 -reject + i=$((i + 1)) + done case ${ipv6_default_interface} in '') |