Lines 98-108
Link Here
|
98 |
fi |
98 |
fi |
99 |
fi |
99 |
fi |
100 |
|
100 |
|
101 |
release=`uname -r` |
|
|
102 |
release=`expr $release : '\(.*\)\..*'` |
103 |
relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'` |
104 |
relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'` |
105 |
|
106 |
### |
101 |
### |
107 |
### DHCPv4 Handlers |
102 |
### DHCPv4 Handlers |
108 |
### |
103 |
### |
Lines 125-130
Link Here
|
125 |
if [ x$new_interface_mtu != x ]; then |
120 |
if [ x$new_interface_mtu != x ]; then |
126 |
mtu_arg="mtu $new_interface_mtu" |
121 |
mtu_arg="mtu $new_interface_mtu" |
127 |
fi |
122 |
fi |
|
|
123 |
if [ x$IF_METRIC != x ]; then |
124 |
metric_arg="metric $IF_METRIC" |
125 |
fi |
128 |
|
126 |
|
129 |
if [ x$reason = xMEDIUM ]; then |
127 |
if [ x$reason = xMEDIUM ]; then |
130 |
# Linux doesn't do mediums (ok, ok, media). |
128 |
# Linux doesn't do mediums (ok, ok, media). |
Lines 136-150
Link Here
|
136 |
# Bring down alias interface. Its routes will disappear too. |
134 |
# Bring down alias interface. Its routes will disappear too. |
137 |
ifconfig $interface:0- inet 0 |
135 |
ifconfig $interface:0- inet 0 |
138 |
fi |
136 |
fi |
139 |
if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ) |
137 |
ifconfig $interface 0 up |
140 |
then |
|
|
141 |
ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ |
142 |
broadcast 255.255.255.255 up |
143 |
# Add route to make broadcast work. Do not omit netmask. |
144 |
route add default dev $interface netmask 0.0.0.0 |
145 |
else |
146 |
ifconfig $interface 0 up |
147 |
fi |
148 |
|
138 |
|
149 |
# We need to give the kernel some time to get the interface up. |
139 |
# We need to give the kernel some time to get the interface up. |
150 |
sleep 1 |
140 |
sleep 1 |
Lines 186-197
Link Here
|
186 |
ifconfig $interface inet $new_ip_address $new_subnet_arg \ |
176 |
ifconfig $interface inet $new_ip_address $new_subnet_arg \ |
187 |
$new_broadcast_arg $mtu_arg |
177 |
$new_broadcast_arg $mtu_arg |
188 |
# Add a network route to the computed network address. |
178 |
# Add a network route to the computed network address. |
189 |
if [ $relmajor -lt 2 ] || \ |
179 |
if [ x$IF_METRIC != x ] && [ x$IF_METRIC != x0 ]; then |
190 |
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then |
180 |
route del -net $new_network_number $new_subnet_arg \ |
191 |
route add -net $new_network_number $new_subnet_arg dev $interface |
181 |
dev $interface |
|
|
182 |
route add -net $new_network_number $new_subnet_arg $metric_arg \ |
183 |
dev $interface |
192 |
fi |
184 |
fi |
193 |
for router in $new_routers; do |
185 |
for router in $new_routers; do |
194 |
route add default gw $router |
186 |
route add default gw $router $metric_arg dev $interface |
195 |
done |
187 |
done |
196 |
fi |
188 |
fi |
197 |
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; |
189 |
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; |
Lines 234-245
Link Here
|
234 |
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg |
226 |
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg |
235 |
route add -host $alias_ip_address dev $interface:0 |
227 |
route add -host $alias_ip_address dev $interface:0 |
236 |
fi |
228 |
fi |
237 |
if [ $relmajor -lt 2 ] || \ |
229 |
# Add a network route to the computed network address. |
238 |
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then |
230 |
if [ x$IF_METRIC != x ] && [ x$IF_METRIC != x0 ]; then |
239 |
route add -net $new_network_number |
231 |
route del -net $new_network_number $new_subnet_arg \ |
|
|
232 |
dev $interface |
233 |
route add -net $new_network_number $new_subnet_arg $metric_arg \ |
234 |
dev $interface |
240 |
fi |
235 |
fi |
241 |
for router in $new_routers; do |
236 |
for router in $new_routers; do |
242 |
route add default gw $router |
237 |
route add default gw $router $metric_arg dev $interface |
243 |
done |
238 |
done |
244 |
make_resolv_conf |
239 |
make_resolv_conf |
245 |
exit_with_hooks 0 |
240 |
exit_with_hooks 0 |