live, net-eth: add DHCP_TIMEOUT when appropriate

It's hardwired at 1/10 of the default /etc/net value
since 3 seconds are enough for properly functioning
DHCP servers in properly maintained networks (those
improper ones tend to have problems with 30 seconds
anyways), and waiting for too long makes users feel
bad for a reason.

Thanks msp@ for bringing attention to this.
This commit is contained in:
Michael Shigorin 2014-02-01 18:22:36 +04:00
parent 4dbd7c40f0
commit 9d7538838c
2 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,7 @@ else
mkdir -p "$prefix"/eth0 && {
echo TYPE=eth
echo BOOTPROTO=dhcp
echo DHCP_TIMEOUT=3
} > "$prefix"/eth0/options
else
verbose "NOT configuring eth0 for DHCP"

View File

@ -19,8 +19,10 @@ IFACEDIR="/etc/net/ifaces"
write_iface() {
dir="$IFACEDIR/$iface"
mkdir -p "$dir"
append=
case "$proto" in
dhcp)
append="DHCP_TIMEOUT=3"
;;
static)
[ -n "$ipv4addr" ] || fatal "ipv4addr missing"
@ -39,6 +41,7 @@ write_iface() {
echo "NM_CONTROLLED=$NMCTL"
echo "DISABLED=$NMCTL"
echo "#USE_IFPLUGD=yes"
[ -z "$append"] || echo "$append"
} > "$dir/options"
}