View | Details | Raw Unified | Return to bug 132476 | Differences between
and this patch

Collapse All | Expand All

(-)etc/rc.d/routing (-15 / +35 lines)
Lines 27-54 Link Here
27
27
28
routing_stop()
28
routing_stop()
29
{
29
{
30
	route -n flush
30
	_fibs_num=`sysctl -n net.fibs`
31
	i=0
32
	while [ $i -lt ${_fibs_num} ] ; do
33
		setfib -F $i route -n flush
34
		i=$((i + 1))
35
	done
31
}
36
}
32
37
33
static_start()
38
static_start()
34
{
39
{
35
	case ${defaultrouter} in
40
	_fibs_num=`sysctl -n net.fibs`
36
	[Nn][Oo] | '')
41
	if [ -n "${static_routes}" ]; then
37
		;;
42
		static_routes_fib0=${static_routes}
38
	*)
43
	fi
39
		static_routes="default ${static_routes}"
44
	if [ -n "${defaultrouter}" ]; then
40
		route_default="default ${defaultrouter}"
45
		defaultrouter_fib0=${defaultrouter}
41
		;;
46
	fi
42
	esac
43
47
44
	# Setup static routes. This should be done before router discovery.
48
	# Setup static routes. This should be done before router discovery.
45
	#
49
	#
46
	if [ -n "${static_routes}" ]; then
50
	n=0
47
		for i in ${static_routes}; do
51
	while [ $n -lt ${_fibs_num} ] ; do
48
			eval route_args=\$route_${i}
52
		eval _drouter=\$defaultrouter_fib${n}
49
			route add ${route_args}
53
		eval _routes=\$static_routes_fib${n}
50
		done
54
51
	fi
55
		case ${_drouter} in
56
		[Nn][Oo] | '')
57
			;;
58
		*)
59
			_routes="default ${_routes}"
60
			route_default="default ${_drouter}"
61
			;;
62
		esac
63
64
		if [ -n "${_routes}" ]; then
65
			for i in ${_routes}; do
66
				eval route_args=\$route_${i}
67
				setfib -F $n route add ${route_args}
68
			done
69
		fi
70
		n=$((n + 1))
71
	done
52
	# Now ATM static routes
72
	# Now ATM static routes
53
	#
73
	#
54
	if [ -n "${natm_static_routes}" ]; then
74
	if [ -n "${natm_static_routes}" ]; then
(-)share/man/man5/rc.conf.5 (-5 / +15 lines)
Lines 2187-2193 Link Here
2187
.Dq Li NO ,
2187
.Dq Li NO ,
2188
create a default route to this host name or IP address
2188
create a default route to this host name or IP address
2189
(use an IP address if this router is also required to get to the
2189
(use an IP address if this router is also required to get to the
2190
name server!).
2190
name server!). It's an equivalent of
2191
.Va defaultrouter_fib0 .
2192
.It Va defaultrouter_fibN
2193
.Pq Vt str
2194
If not set to
2195
.Dq Li NO ,
2196
create a default route to this host name or IP address in FIB
2197
number N. See the setfib(1).
2191
.It Va ipv6_defaultrouter
2198
.It Va ipv6_defaultrouter
2192
.Pq Vt str
2199
.Pq Vt str
2193
The IPv6 equivalent of
2200
The IPv6 equivalent of
Lines 2195-2204 Link Here
2195
.It Va static_routes
2202
.It Va static_routes
2196
.Pq Vt str
2203
.Pq Vt str
2197
Set to the list of static routes that are to be added at system
2204
Set to the list of static routes that are to be added at system
2198
boot time.
2205
boot time. (It's an equivalent of
2199
If not set to
2206
.Va static_routes_fib0 )
2200
.Dq Li NO
2207
If not empty then for each whitespace separated
2201
then for each whitespace separated
2202
.Ar element
2208
.Ar element
2203
in the value, a
2209
in the value, a
2204
.Va route_ Ns Aq Ar element
2210
.Va route_ Ns Aq Ar element
Lines 2212-2217 Link Here
2212
route_mcast="-net 224.0.0.0/4 -iface gif0"
2218
route_mcast="-net 224.0.0.0/4 -iface gif0"
2213
route_gif0local="-host 169.254.1.1 -iface lo0"
2219
route_gif0local="-host 169.254.1.1 -iface lo0"
2214
.Ed
2220
.Ed
2221
.It Va static_routes_fibN
2222
.Pq Vt str
2223
Set to the list of static routes that are to be added in FIB
2224
number N. See setfib(1).
2215
.It Va ipv6_static_routes
2225
.It Va ipv6_static_routes
2216
.Pq Vt str
2226
.Pq Vt str
2217
The IPv6 equivalent of
2227
The IPv6 equivalent of

Return to bug 132476