|
Lines 61-71
Link Here
|
| 61 |
ifconfig "${interface}" ${ip} ${broadcast} ${netmask} ${mtu} |
61 |
ifconfig "${interface}" ${ip} ${broadcast} ${netmask} ${mtu} |
| 62 |
} |
62 |
} |
| 63 |
|
63 |
|
|
|
64 |
update_classless_routes() |
| 65 |
{ |
| 66 |
if [ -n "${staticroutes}" ] ; then |
| 67 |
max_routes=128 |
| 68 |
metric= |
| 69 |
[ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}" |
| 70 |
while [ -n "$1" -a -n "$2" -a $max_routes -gt 0 ]; do |
| 71 |
gw_arg= |
| 72 |
if [ "$2" != '0.0.0.0' ]; then |
| 73 |
gw_arg="gw $2" |
| 74 |
fi |
| 75 |
|
| 76 |
[ ${1##*/} -eq 32 ] && type=host || type=net |
| 77 |
route add -$type "$1" ${gw_arg} ${metric} dev "${interface}" |
| 78 |
max=$(($max-1)) |
| 79 |
shift 2 |
| 80 |
done |
| 81 |
fi |
| 82 |
} |
| 64 |
update_routes() |
83 |
update_routes() |
| 65 |
{ |
84 |
{ |
| 66 |
peer_var "${PEER_ROUTERS}" && return |
85 |
peer_var "${PEER_ROUTERS}" && return |
| 67 |
|
86 |
|
| 68 |
if [ -n "${router}" ] ; then |
87 |
# RFC 3442 |
|
|
88 |
[ -n "${staticroutes}" ] && update_classless_routes $staticroutes |
| 89 |
|
| 90 |
# If the DHCP server returns both a Classless Static Routes option and |
| 91 |
# a Router option, the DHCP client MUST ignore the Router option. |
| 92 |
if [ -n "${router}" -a -z "${staticroutes}" ] ; then |
| 69 |
metric= |
93 |
metric= |
| 70 |
[ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}" |
94 |
[ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}" |
| 71 |
for i in ${router} ; do |
95 |
for i in ${router} ; do |