diff options
Diffstat (limited to 'dhcpv6/client.go')
-rw-r--r-- | dhcpv6/client.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dhcpv6/client.go b/dhcpv6/client.go index 10a20c9..24b6e0d 100644 --- a/dhcpv6/client.go +++ b/dhcpv6/client.go @@ -127,6 +127,13 @@ func (c *Client) sendReceive(ifname string, packet DHCPv6, expectedType MessageT return nil, err } defer conn.Close() + // wait for the listener to be ready + for { + if conn.LocalAddr() != nil { + break + } + time.Sleep(10 * time.Millisecond) + } // send the packet out conn.SetWriteDeadline(time.Now().Add(c.WriteTimeout)) |