From 175868d67987770d2d729186f7676e0b98f925df Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Mon, 4 Mar 2019 12:47:50 -0800 Subject: client6: new async DHCPv6 client like #250. - Race-condition-averse. - Supports multiple concurrent requests. - Tested. - Requires a fully compatible net.PacketConn. Signed-off-by: Christopher Koch --- dhcpv6/client6/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dhcpv6/client6') diff --git a/dhcpv6/client6/client.go b/dhcpv6/client6/client.go index b1f8e11..c7bd318 100644 --- a/dhcpv6/client6/client.go +++ b/dhcpv6/client6/client.go @@ -199,7 +199,11 @@ func (c *Client) sendReceive(ifname string, packet dhcpv6.DHCPv6, expectedType d // an error if any. The modifiers will be applied to the Solicit before sending // it, see modifiers.go func (c *Client) Solicit(ifname string, modifiers ...dhcpv6.Modifier) (dhcpv6.DHCPv6, dhcpv6.DHCPv6, error) { - solicit, err := dhcpv6.NewSolicitForInterface(ifname) + iface, err := net.InterfaceByName(ifname) + if err != nil { + return nil, nil, err + } + solicit, err := dhcpv6.NewSolicit(iface.HardwareAddr) if err != nil { return nil, nil, err } -- cgit v1.2.3