summaryrefslogtreecommitdiffhomepage
path: root/netboot
diff options
context:
space:
mode:
authorinsomniac <insomniacslk@users.noreply.github.com>2018-08-15 14:01:33 +0100
committerGitHub <noreply@github.com>2018-08-15 14:01:33 +0100
commitd13677dad515f3e103037c70c6102410d8f3fca0 (patch)
tree398eec6930715890d10cbd289926c502c05f312f /netboot
parente14f9e09d34be98fddb8686af726d7e6692f2e3b (diff)
parentf479e18af71117de34cb44d0ffcc2b7b724488ce (diff)
Merge pull request #137 from insomniacslk/netboot_withnetboot_duplicate
Fixing duplicate WithNetboot modifier in netboot package
Diffstat (limited to 'netboot')
-rw-r--r--netboot/netboot.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/netboot/netboot.go b/netboot/netboot.go
index 81ba144..2f4cc8f 100644
--- a/netboot/netboot.go
+++ b/netboot/netboot.go
@@ -15,7 +15,6 @@ func RequestNetbootv6(ifname string, timeout time.Duration, retries int, modifie
var (
conversation []dhcpv6.DHCPv6
)
- modifiers = append(modifiers, dhcpv6.WithNetboot)
delay := 2 * time.Second
for i := 0; i <= retries; i++ {
log.Printf("sending request, attempt #%d", i+1)
@@ -26,6 +25,9 @@ func RequestNetbootv6(ifname string, timeout time.Duration, retries int, modifie
client := dhcpv6.NewClient()
client.ReadTimeout = timeout
+ // WithNetboot is added only later, to avoid applying it twice (one
+ // here and one in the above call to NewSolicitForInterface)
+ modifiers = append(modifiers, dhcpv6.WithNetboot)
conversation, err = client.Exchange(ifname, solicit, modifiers...)
if err != nil {
log.Printf("Client.Exchange failed: %v", err)