From f479e18af71117de34cb44d0ffcc2b7b724488ce Mon Sep 17 00:00:00 2001 From: Andrea Barberio Date: Wed, 15 Aug 2018 13:29:45 +0100 Subject: Fixing duplicate WithNetboot modifier in netboot package --- netboot/netboot.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3