diff options
author | insomniac <insomniacslk@users.noreply.github.com> | 2018-09-27 20:05:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 20:05:34 +0100 |
commit | 705562ea82b711f372f75ad325d180372ae2ac40 (patch) | |
tree | 44b57f2679ade2563f8a2adfcf9e959d0d359db8 /dhcpv6/client.go | |
parent | f10e01a9bfb08a7b74bd9d322b26bc354cb04ad1 (diff) | |
parent | 93e07e83bb197ce356a596dc8e57f134c3ce5fef (diff) |
Implemented basic DHCPv6 server handler (#157)
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)) |