blob: d299cc503f606b239fb1573070b3ab2f7fbf42fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
--- dhcp-4.3.6/client/scripts/linux
+++ dhcp-4.3.6/client/scripts/linux
@@ -242,20 +242,22 @@
if_metric=${if_metric:-1}
fi
- for router in $new_routers; do
- if [ "$new_subnet_mask" = "255.255.255.255" ]; then
- # point-to-point connection => set explicit route
- ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
- fi
-
- # set default route
- ${ip} -4 route add default via ${router} dev ${interface} \
- ${if_metric:+metric $if_metric} >/dev/null 2>&1
-
- if [ -n "$if_metric" ]; then
- if_metric=$((if_metric+1))
- fi
- done
+ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
+ for router in $new_routers; do
+ if [ "$new_subnet_mask" = "255.255.255.255" ]; then
+ # point-to-point connection => set explicit route
+ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+ fi
+
+ # set default route
+ ${ip} -4 route add default via ${router} dev ${interface} \
+ ${if_metric:+metric $if_metric} >/dev/null 2>&1
+
+ if [ -n "$if_metric" ]; then
+ if_metric=$((if_metric+1))
+ fi
+ done
+ fi
fi
fi
@@ -330,15 +332,17 @@
if_metric=${if_metric:-1}
fi
- # set default route
- for router in $new_routers; do
- ${ip} -4 route add default via ${router} dev ${interface} \
- ${if_metric:+metric $if_metric} >/dev/null 2>&1
-
- if [ -n "$if_metric" ]; then
- if_metric=$((if_metric+1))
- fi
- done
+ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
+ # set default route
+ for router in $new_routers; do
+ ${ip} -4 route add default via ${router} dev ${interface} \
+ ${if_metric:+metric $if_metric} >/dev/null 2>&1
+
+ if [ -n "$if_metric" ]; then
+ if_metric=$((if_metric+1))
+ fi
+ done
+ fi
fi
# update /etc/resolv.conf
|