diff options
author | Pablo Mazzini <pmazzini@gmail.com> | 2022-11-28 16:42:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 16:42:07 +0000 |
commit | f26e6d78f6222c99004834c064cd32250115721c (patch) | |
tree | fc3521767826e963a15c95e62dd9984fbd106927 | |
parent | 5308ebe5334c1fbefc2a12a6fae01e3c75b3c2cf (diff) | |
parent | 68ec6dab8c733b92772dace938a4a9eba6ce3494 (diff) |
Merge pull request #483 from abrender/patch-1
Return error from RequestNetbootv4
-rw-r--r-- | netboot/netboot.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/netboot/netboot.go b/netboot/netboot.go index b32f69e..adfc7f3 100644 --- a/netboot/netboot.go +++ b/netboot/netboot.go @@ -48,7 +48,6 @@ func RequestNetbootv6(ifname string, timeout time.Duration, retries int, modifie if err != nil { log.Printf("Client.Exchange failed: %v", err) if i >= retries { - // don't wait at the end of the last attempt return nil, fmt.Errorf("netboot failed after %d attempts: %v", retries+1, err) } log.Printf("sleeping %v before retrying", delay) @@ -80,8 +79,7 @@ func RequestNetbootv4(ifname string, timeout time.Duration, retries int, modifie log.Printf("Client.Exchange failed: %v", err) log.Printf("sleeping %v before retrying", delay) if i >= retries { - // don't wait at the end of the last attempt - break + return nil, fmt.Errorf("netboot failed after %d attempts: %v", retries+1, err) } sleeper(delay) // TODO add random splay |