Commit 9d753883 authored by Michael Shigorin's avatar Michael Shigorin

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.
parent 4dbd7c40
...@@ -57,6 +57,7 @@ else ...@@ -57,6 +57,7 @@ else
mkdir -p "$prefix"/eth0 && { mkdir -p "$prefix"/eth0 && {
echo TYPE=eth echo TYPE=eth
echo BOOTPROTO=dhcp echo BOOTPROTO=dhcp
echo DHCP_TIMEOUT=3
} > "$prefix"/eth0/options } > "$prefix"/eth0/options
else else
verbose "NOT configuring eth0 for DHCP" verbose "NOT configuring eth0 for DHCP"
......
...@@ -19,8 +19,10 @@ IFACEDIR="/etc/net/ifaces" ...@@ -19,8 +19,10 @@ IFACEDIR="/etc/net/ifaces"
write_iface() { write_iface() {
dir="$IFACEDIR/$iface" dir="$IFACEDIR/$iface"
mkdir -p "$dir" mkdir -p "$dir"
append=
case "$proto" in case "$proto" in
dhcp) dhcp)
append="DHCP_TIMEOUT=3"
;; ;;
static) static)
[ -n "$ipv4addr" ] || fatal "ipv4addr missing" [ -n "$ipv4addr" ] || fatal "ipv4addr missing"
...@@ -39,6 +41,7 @@ write_iface() { ...@@ -39,6 +41,7 @@ write_iface() {
echo "NM_CONTROLLED=$NMCTL" echo "NM_CONTROLLED=$NMCTL"
echo "DISABLED=$NMCTL" echo "DISABLED=$NMCTL"
echo "#USE_IFPLUGD=yes" echo "#USE_IFPLUGD=yes"
[ -z "$append"] || echo "$append"
} > "$dir/options" } > "$dir/options"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment