diff options
author | Andrea Barberio <insomniac@slackware.it> | 2018-08-15 13:29:45 +0100 |
---|---|---|
committer | Andrea Barberio <insomniac@slackware.it> | 2018-08-15 13:29:45 +0100 |
commit | f479e18af71117de34cb44d0ffcc2b7b724488ce (patch) | |
tree | d5614bdc1798a8531d333b0c6ecbb398888e3fb1 /netboot | |
parent | 35ed68606514ab77a523f72b103474e36361bcf7 (diff) |
Fixing duplicate WithNetboot modifier in netboot package
Diffstat (limited to 'netboot')
-rw-r--r-- | netboot/netboot.go | 4 |
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) |