diff options
author | Christopher Koch <chrisko@google.com> | 2019-03-04 12:47:50 -0800 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2019-04-04 12:49:08 +0100 |
commit | 175868d67987770d2d729186f7676e0b98f925df (patch) | |
tree | 2d56b1cb28fddd14ad935fa3c41dcc368b31e30c /dhcpv6/dhcpv6message.go | |
parent | b40bd52ae58aee37cec9ef81008e24488350c98f (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/dhcpv6message.go')
-rw-r--r-- | dhcpv6/dhcpv6message.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go index 9e03fa7..9237c1b 100644 --- a/dhcpv6/dhcpv6message.go +++ b/dhcpv6/dhcpv6message.go @@ -70,18 +70,14 @@ func NewSolicitWithCID(duid Duid, modifiers ...Modifier) (*Message, error) { return m, nil } -// NewSolicitForInterface creates a new SOLICIT message with DUID-LLT, using the +// NewSolicit creates a new SOLICIT message with DUID-LLT, using the // given network interface's hardware address and current time -func NewSolicitForInterface(ifname string, modifiers ...Modifier) (*Message, error) { - iface, err := net.InterfaceByName(ifname) - if err != nil { - return nil, err - } +func NewSolicit(ifaceHWAddr net.HardwareAddr, modifiers ...Modifier) (*Message, error) { duid := Duid{ Type: DUID_LLT, HwType: iana.HWTypeEthernet, Time: GetTime(), - LinkLayerAddr: iface.HardwareAddr, + LinkLayerAddr: ifaceHWAddr, } return NewSolicitWithCID(duid, modifiers...) } |