Skip to content

Commit

Permalink
test better udhcpc behaviour (#553)
Browse files Browse the repository at this point in the history
Co-authored-by: Christophe de Carvalho <[email protected]>
  • Loading branch information
delandtj and zaibon authored Feb 28, 2020
1 parent b904f34 commit 7ef6841
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/network/dhcp/dhcp.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dhcp

import (
"fmt"
"os/exec"

"github.com/rs/zerolog/log"
Expand All @@ -22,9 +23,10 @@ func (d *Probe) Start(inf string) error {
d.cmd = exec.Command("udhcpc",
"-f", //foreground
"-i", inf,
"-t", "5", //try 5 times before giving up
"-A", "20", //wait 20 seconds between each trial
"-t", "20", //send 20 dhcp queries
"-T", "1", // every second
"-s", "/usr/share/udhcp/simple.script",
"-p", fmt.Sprintf("/run/udhcpc.%s.pid", inf),
"--now", // exit if lease is not obtained
)

Expand Down

0 comments on commit 7ef6841

Please sign in to comment.