1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Add dhcp timeout parameter

This commit is contained in:
Jason-ZW
2018-10-22 10:11:12 +08:00
committed by niusmallnan
parent a088811de9
commit ef663b4e70
7 changed files with 31 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import (
"net"
"os"
"os/exec"
"strconv"
"strings"
"sync"
"syscall"
@@ -290,6 +291,10 @@ func runDhcp(netCfg *NetworkConfig, iface string, argstr string, setHostname, se
args = append(args, "--nohook", "resolv.conf")
}
if netCfg.DHCPTimeout > 0 {
args = append(args, "--timeout", strconv.Itoa(netCfg.DHCPTimeout))
}
// Wait for lease
// TODO: this should be optional - based on kernel arg?
args = append(args, "-w", "--debug")