Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2012 15:31:47 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r230948 - projects/multi-fibv6/head/etc/rc.d
Message-ID:  <201202031531.q13FVl4u093176@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri Feb  3 15:31:47 2012
New Revision: 230948
URL: http://svn.freebsd.org/changeset/base/230948

Log:
  Install the IPv6 reject routes we do for the default FIB to all FIBs.
  
  Sponsored by:	Cisco Systems, Inc.

Modified:
  projects/multi-fibv6/head/etc/rc.d/routing

Modified: projects/multi-fibv6/head/etc/rc.d/routing
==============================================================================
--- projects/multi-fibv6/head/etc/rc.d/routing	Fri Feb  3 15:26:55 2012	(r230947)
+++ projects/multi-fibv6/head/etc/rc.d/routing	Fri Feb  3 15:31:47 2012	(r230948)
@@ -137,12 +137,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] | '')
@@ -214,8 +224,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
 	'')



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202031531.q13FVl4u093176>