View | Details | Raw Unified | Return to bug 145440
Collapse All | Expand All

(-)/etc/rc.d/routing (-26 / +50 lines)
Lines 27-62 Link Here
27
27
28
routing_stop()
28
routing_stop()
29
{
29
{
30
	route -n flush
30
	fibcount=`sysctl -n net.fibs`
31
	[ -z $fibcount ] && fibcount=1
32
	i=0
33
	while [ $i -lt $fibcount ]; do
34
		setfib $i route -n flush
35
		i=$((i + 1))
36
	done
31
}
37
}
32
38
33
static_start()
39
static_start()
34
{
40
{
35
	case ${defaultrouter} in
41
	fib=0
36
	[Nn][Oo] | '')
42
	setfib=''
37
		;;
43
	while : ; do
38
	*)
44
		if [ $fib -gt 0 ]; then
39
		static_routes="default ${static_routes}"
45
			eval defaultrouter=\$defaultrouter_fib${fib}
40
		route_default="default ${defaultrouter}"
46
			eval static_routes=\$static_routes_fib${fib}
41
		;;
47
			eval natm_static_routes=\$natm_static_routes_fib${fib}
42
	esac
48
			setfib="setfib $fib"
43
49
			[ -z "${defaultrouter}" -a -z "${static_routes}" -a \
44
	# Setup static routes. This should be done before router discovery.
50
			-z "${natm_static_routes}" ] && break
45
	#
51
		fi
46
	if [ -n "${static_routes}" ]; then
52
47
		for i in ${static_routes}; do
53
		case ${defaultrouter} in
48
			eval route_args=\$route_${i}
54
		[Nn][Oo] | '')
49
			route add ${route_args}
55
			;;
50
		done
56
		*)
51
	fi
57
			static_routes="default ${static_routes}"
52
	# Now ATM static routes
58
			route_default="default ${defaultrouter}"
53
	#
59
			;;
54
	if [ -n "${natm_static_routes}" ]; then
60
		esac
55
		for i in ${natm_static_routes}; do
61
56
			eval route_args=\$route_${i}
62
		# Setup static routes. This should be done before router
57
			atmconfig natm add ${route_args}
63
		# discovery.
58
		done
64
		#
59
	fi
65
		if [ -n "${static_routes}" ]; then
66
			for i in ${static_routes}; do
67
				eval route_args=\$route_${i}
68
				${setfib} route add ${route_args}
69
			done
70
		fi
71
		# Now ATM static routes
72
		#
73
		if [ -n "${natm_static_routes}" ]; then
74
			for i in ${natm_static_routes}; do
75
				eval route_args=\$route_${i}
76
				${setfib} atmconfig natm add ${route_args}
77
			done
78
		fi
79
80
		# Loop through all fib configs
81
		#
82
		fib=$((fib + 1))
83
	done
60
}
84
}
61
85
62
_ropts_initdone=
86
_ropts_initdone=

Return to bug 145440