summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/client6
diff options
context:
space:
mode:
authorChristopher Koch <chrisko@google.com>2019-03-04 12:47:50 -0800
committerinsomniac <insomniacslk@users.noreply.github.com>2019-04-04 12:49:08 +0100
commit175868d67987770d2d729186f7676e0b98f925df (patch)
tree2d56b1cb28fddd14ad935fa3c41dcc368b31e30c /dhcpv6/client6
parentb40bd52ae58aee37cec9ef81008e24488350c98f (diff)
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 <chrisko@google.com>
Diffstat (limited to 'dhcpv6/client6')
-rw-r--r--dhcpv6/client6/client.go6
1 files changed, 5 insertions, 1 deletions
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
}