|
Lines 96-101
test "$1" = "-o" && shift
Link Here
|
| 96 |
OPTIONS=$@ |
96 |
OPTIONS=$@ |
| 97 |
MODE=manual |
97 |
MODE=manual |
| 98 |
HOTPLUG=no |
98 |
HOTPLUG=no |
|
|
99 |
BOOTING=no |
| 99 |
CONTROL_IFPLUGD=yes # Start/Stop ifplugd? |
100 |
CONTROL_IFPLUGD=yes # Start/Stop ifplugd? |
| 100 |
# Don't log messages from ifstatus in syslog by default (Bug 261350). This |
101 |
# Don't log messages from ifstatus in syslog by default (Bug 261350). This |
| 101 |
# overwrites the config variable /etc/sysconfig/network/config:USE_SYSLOG |
102 |
# overwrites the config variable /etc/sysconfig/network/config:USE_SYSLOG |
|
Lines 103-109
export DONT_USE_SYSLOG=no
Link Here
|
| 103 |
test "$SCRIPTNAME" == ifstatus && DONT_USE_SYSLOG=yes |
104 |
test "$SCRIPTNAME" == ifstatus && DONT_USE_SYSLOG=yes |
| 104 |
while [ $# -gt 0 ]; do |
105 |
while [ $# -gt 0 ]; do |
| 105 |
case $1 in |
106 |
case $1 in |
| 106 |
boot|onboot) MODE=auto ;; |
107 |
boot|onboot) MODE=auto ; BOOTING=yes ;; |
| 107 |
auto) MODE=auto ;; |
108 |
auto) MODE=auto ;; |
| 108 |
hotplug) MODE=auto |
109 |
hotplug) MODE=auto |
| 109 |
HOTPLUG=yes ;; |
110 |
HOTPLUG=yes ;; |
|
Lines 423-429
setexitstate () {
Link Here
|
| 423 |
esac |
424 |
esac |
| 424 |
commit_cached_config_data $INTERFACE |
425 |
commit_cached_config_data $INTERFACE |
| 425 |
commit_cached_config_data $INTERFACE PFX=ifup- |
426 |
commit_cached_config_data $INTERFACE PFX=ifup- |
| 426 |
;; |
427 |
;; |
| 427 |
ifdown) |
428 |
ifdown) |
| 428 |
test "$HOTPLUG" = yes && RET_STATE=removed |
429 |
test "$HOTPLUG" = yes && RET_STATE=removed |
| 429 |
test "$RUN_FROM_RC" = yes && RET_STATE=removed |
430 |
test "$RUN_FROM_RC" = yes && RET_STATE=removed |
|
Lines 447-453
setexitstate () {
Link Here
|
| 447 |
commit_cached_config_data $INTERFACE |
448 |
commit_cached_config_data $INTERFACE |
| 448 |
delete_from_cached_config_data '*' '' $INTERFACE PFX=ifup- |
449 |
delete_from_cached_config_data '*' '' $INTERFACE PFX=ifup- |
| 449 |
commit_cached_config_data $INTERFACE PFX=ifup- |
450 |
commit_cached_config_data $INTERFACE PFX=ifup- |
| 450 |
;; |
451 |
;; |
| 451 |
esac |
452 |
esac |
| 452 |
} |
453 |
} |
| 453 |
|
454 |
|
|
Lines 501-506
DEVNAME=
Link Here
|
| 501 |
if [ -n "$VENDORID$PRODUCTID" -a "$BUSNAME" = pci -a -x /sbin/lspci ] ; then |
502 |
if [ -n "$VENDORID$PRODUCTID" -a "$BUSNAME" = pci -a -x /sbin/lspci ] ; then |
| 502 |
DEVNAME=`lspci -d $VENDORID:$PRODUCTID 2>/dev/null | sed -n 1p` |
503 |
DEVNAME=`lspci -d $VENDORID:$PRODUCTID 2>/dev/null | sed -n 1p` |
| 503 |
DEVNAME=${DEVNAME#*: } |
504 |
DEVNAME=${DEVNAME#*: } |
|
|
505 |
if [ "$RUN_FROM_RC" = yes ] ; then |
| 506 |
DEVNAME=${DEVNAME%%[(\[]*} |
| 507 |
DEVNAME=${DEVNAME:0:45} |
| 508 |
NAME=${NAME:0:45} |
| 509 |
fi |
| 504 |
elif [ "$BUSNAME" = pcmcia ] ; then |
510 |
elif [ "$BUSNAME" = pcmcia ] ; then |
| 505 |
DEVNAME=`cat /sys/class/net/$INTERFACE/device/prod_id* 2>/dev/null` |
511 |
DEVNAME=`cat /sys/class/net/$INTERFACE/device/prod_id* 2>/dev/null` |
| 506 |
fi |
512 |
fi |
|
Lines 1037-1045
case "$BOOTPROTO$SKIP_MAIN_PART" in
Link Here
|
| 1037 |
# else |
1043 |
# else |
| 1038 |
# message_n "`printf "IP/Netmask: %s / %s " $IPADDR $NETMASK`" |
1044 |
# message_n "`printf "IP/Netmask: %s / %s " $IPADDR $NETMASK`" |
| 1039 |
fi |
1045 |
fi |
| 1040 |
if [ "$INTERFACETYPE" == bond ] ; then |
|
|
| 1041 |
message_n " as bonding master" |
| 1042 |
fi |
| 1043 |
message " " |
1046 |
message " " |
| 1044 |
;; |
1047 |
;; |
| 1045 |
esac |
1048 |
esac |
|
Lines 1096-1123
case "$BOOTPROTO$SKIP_MAIN_PART" in
Link Here
|
| 1096 |
ifup-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} |
1099 |
ifup-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} |
| 1097 |
|
1100 |
|
| 1098 |
# |
1101 |
# |
| 1099 |
# OK, everything is set up here .. lets check the state |
1102 |
# OK, all setup done ... check the state now |
|
|
1103 |
# |
| 1104 |
# Do not override codes when already set (e.g. $R_DHCP_BG); |
| 1105 |
# it is the final action to check the link / dad status. |
| 1106 |
# |
| 1107 |
# When called from rcnetwork, do not wait as rcnetwork does. |
| 1100 |
# |
1108 |
# |
|
|
1109 |
dad_ret=0 |
| 1110 |
link_ret=0 |
| 1101 |
|
1111 |
|
| 1102 |
# - link |
1112 |
# - check the link (carrier, ...) |
| 1103 |
link_ready_wait "$INTERFACE" "${LINK_READY_WAIT:-$((WAIT_FOR_INTERFACES/2))}" |
1113 |
# per interface setting, disabled by default |
| 1104 |
link_ret=$? |
|
|
| 1105 |
if [ "$retcode" = "$R_SUCCESS" ] ; then |
1114 |
if [ "$retcode" = "$R_SUCCESS" ] ; then |
| 1106 |
# do not override codes when already set (e.g. $R_DHCP_BG) |
1115 |
if [ $((LINK_READY_WAIT)) -gt 0 ] ; then |
| 1107 |
case "$link_ret" in |
1116 |
if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then |
| 1108 |
1|2|3) retcode=$R_NOTRUNNING ;; |
1117 |
link_ready_check "$INTERFACE" |
| 1109 |
esac |
1118 |
link_ret=$? |
|
|
1119 |
test "$link_ret" && retcode=$R_DHCP_BG |
| 1120 |
else |
| 1121 |
link_ready_wait "$INTERFACE" "${LINK_READY_WAIT}" |
| 1122 |
link_ret=$? |
| 1123 |
test "$link_ret" && retcode=$R_NOTRUNNING |
| 1124 |
fi |
| 1125 |
fi |
| 1110 |
fi |
1126 |
fi |
| 1111 |
|
1127 |
|
| 1112 |
# - dad |
1128 |
# - check ipv6 dad |
| 1113 |
if [ "$retcode" = "$R_SUCCESS" -a -d /proc/sys/net/ipv6 ] ; then |
1129 |
# global (and per interface) setting, enabled by default |
| 1114 |
IPV6_DAD_WAIT=${IPV6_DAD_WAIT:-$((WAIT_FOR_INTERFACES/5))} |
1130 |
# when the link isn't ready yet, the addresses are marked tentative |
| 1115 |
ipv6_addr_dad_wait "$INTERFACE" "$IPV6_DAD_WAIT" |
1131 |
# dad starts when the link becomes ready and we wait until success |
| 1116 |
dad_ret=$? |
1132 |
# or dad failure. |
| 1117 |
case $dad_ret in |
1133 |
if [ "$retcode" = "$R_SUCCESS" ] ; then |
| 1118 |
1|2) retcode=$R_NOTRUNNING ;; |
1134 |
IPV6_DAD_WAIT=${IPV6_DAD_WAIT:-$((WAIT_FOR_INTERFACES/2))} |
| 1119 |
3) retcode=$R_DHCP_BG ;; |
1135 |
if [ $((IPV6_DAD_WAIT)) -gt 0 ] ; then |
| 1120 |
esac |
1136 |
if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then |
|
|
1137 |
ipv6_addr_dad_check "$INTERFACE" |
| 1138 |
dad_ret=$? |
| 1139 |
else |
| 1140 |
ipv6_addr_dad_wait "$INTERFACE" "${IPV6_DAD_WAIT}" |
| 1141 |
dad_ret=$? |
| 1142 |
fi |
| 1143 |
case $dad_ret in |
| 1144 |
1|2) retcode=$R_NOTRUNNING ;; |
| 1145 |
3) retcode=$R_DHCP_BG ;; |
| 1146 |
esac |
| 1147 |
fi |
| 1148 |
fi |
| 1149 |
|
| 1150 |
# inform ifstatus to update status connecting flag |
| 1151 |
if [ $retcode -eq $R_DHCP_BG -a \( $link_ret -ne 0 -o $dad_ret -ne 0 \) ] ; then |
| 1152 |
write_cached_config_data verify status $INTERFACE |
| 1121 |
fi |
1153 |
fi |
| 1122 |
|
1154 |
|
| 1123 |
;; |
1155 |
;; |
|
Lines 1154-1178
case "$BOOTPROTO$SKIP_MAIN_PART" in
Link Here
|
| 1154 |
|
1186 |
|
| 1155 |
ifstatus-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} |
1187 |
ifstatus-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} |
| 1156 |
|
1188 |
|
| 1157 |
retcode=$R_SUCCESS |
|
|
| 1158 |
dad_ret=0 |
1189 |
dad_ret=0 |
| 1159 |
link_ret=0 |
1190 |
link_ret=0 |
|
|
1191 |
retcode=$R_SUCCESS |
| 1160 |
|
1192 |
|
| 1161 |
# Check the link |
1193 |
# - check the link |
| 1162 |
if [ -n "$LINK_READY_WAIT" -a $((LINK_READY_WAIT)) -gt 0 ] ; then |
1194 |
if [ $((LINK_READY_WAIT)) -gt 0 ] ; then |
| 1163 |
# check the link |
1195 |
link_ready_check "$INTERFACE" |
| 1164 |
link_ready_check "$INTERFACE" || link_ret=$? |
1196 |
link_ret=$? |
| 1165 |
case $link_ret in |
1197 |
if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then |
| 1166 |
1|2|3) retcode=$R_NOTRUNNING ;; |
1198 |
test "$link_ret" && retcode=$R_DHCP_BG |
| 1167 |
esac |
1199 |
else |
|
|
1200 |
test "$link_ret" && retcode=$R_NOTRUNNING |
| 1201 |
fi |
| 1168 |
fi |
1202 |
fi |
| 1169 |
|
1203 |
|
| 1170 |
# Check ipv6 dad |
1204 |
# - check ipv6 dad |
| 1171 |
if [ "$retcode" = "$R_SUCCESS" -a -d /proc/sys/net/ipv6 ] ; then |
1205 |
if [ "$retcode" = "$R_SUCCESS" ] ; then |
| 1172 |
IPV6_DAD_WAIT=${IPV6_DAD_WAIT:-$((WAIT_FOR_INTERFACES/5))} |
1206 |
IPV6_DAD_WAIT=$((${IPV6_DAD_WAIT:-$((WAIT_FOR_INTERFACES/2))})) |
| 1173 |
if [ $((IPV6_DAD_WAIT)) -gt 0 ] ; then |
1207 |
if [ $((IPV6_DAD_WAIT)) -ge 0 ] ; then |
| 1174 |
ipv6_addr_dad_check "$INTERFACE" |
1208 |
ipv6_addr_dad_check "$INTERFACE" |
| 1175 |
dad_ret=$? |
1209 |
dad_ret=$? |
|
|
1210 |
case $dad_ret in |
| 1211 |
1|2) retcode=$R_NOTRUNNING ;; |
| 1212 |
3) retcode=$R_DHCP_BG ;; |
| 1213 |
esac |
| 1176 |
fi |
1214 |
fi |
| 1177 |
fi |
1215 |
fi |
| 1178 |
|
1216 |
|
|
Lines 1190-1201
case "$BOOTPROTO$SKIP_MAIN_PART" in
Link Here
|
| 1190 |
2) message "`printf " %-9s is dormant" "$INTERFACE"`" ;; |
1228 |
2) message "`printf " %-9s is dormant" "$INTERFACE"`" ;; |
| 1191 |
3) message "`printf " %-9s has no carrier" "$INTERFACE"`" ;; |
1229 |
3) message "`printf " %-9s has no carrier" "$INTERFACE"`" ;; |
| 1192 |
esac |
1230 |
esac |
|
|
1231 |
|
| 1232 |
if [ "$retcode" = "$R_SUCCESS" ] ; then |
| 1233 |
v=`read_cached_config_data verify $INTERFACE` |
| 1234 |
s=`read_cached_config_data status $INTERFACE` |
| 1235 |
if test "$v" = "status" -a "$s" = "connecting" ; then |
| 1236 |
write_cached_config_data status connected $INTERFACE |
| 1237 |
commit_cached_config_data $INTERFACE |
| 1238 |
fi |
| 1239 |
fi |
| 1193 |
else |
1240 |
else |
| 1194 |
# message_if_not_run_from_rc "$INTERFACE is down" |
1241 |
# message_if_not_run_from_rc "$INTERFACE is down" |
| 1195 |
message "`printf " %-9s is down" $INTERFACE`" |
1242 |
message "`printf " %-9s is down" $INTERFACE`" |
| 1196 |
retcode=$R_NOTRUNNING |
1243 |
retcode=$R_NOTRUNNING |
| 1197 |
case "$STARTMODE" in |
1244 |
case "$STARTMODE" in |
| 1198 |
manual|off) retcode=$R_INACTIVE ;; |
1245 |
manual|off) retcode=$R_INACTIVE ;; |
| 1199 |
esac |
1246 |
esac |
| 1200 |
fi |
1247 |
fi |
| 1201 |
;; |
1248 |
;; |
|
Lines 1221-1227
if [ "$DHCP" != yes ] ; then
Link Here
|
| 1221 |
test "$CHECK" = yes -a $ret != 0 && retcode=$ret |
1268 |
test "$CHECK" = yes -a $ret != 0 && retcode=$ret |
| 1222 |
DEP_IFACES=`get_depending_ifaces $INTERFACE` |
1269 |
DEP_IFACES=`get_depending_ifaces $INTERFACE` |
| 1223 |
if [ "$?" = 0 -a "$NODEPS" != yes ] ; then |
1270 |
if [ "$?" = 0 -a "$NODEPS" != yes ] ; then |
| 1224 |
message "`printf " %-9s is still used from interfaces %s" \ |
1271 |
message "`printf " %-9s is used from interfaces %s" \ |
| 1225 |
$INTERFACE "$DEP_IFACES"`" |
1272 |
$INTERFACE "$DEP_IFACES"`" |
| 1226 |
#for DI in $DEP_IFACES; do |
1273 |
#for DI in $DEP_IFACES; do |
| 1227 |
# ifstatus $DI -o $OPTIONS |
1274 |
# ifstatus $DI -o $OPTIONS |