summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/async/client_test.go
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2019-04-23 23:09:44 +0100
committerinsomniac <insomniacslk@users.noreply.github.com>2019-04-24 21:37:02 +0100
commit8166b9a9db9b180c02622ebf3dcff01ff2b2e0a6 (patch)
tree31d3044177cebed28784b1b282a9ea73fc9b65a6 /dhcpv6/async/client_test.go
parentebf43962e121b9c5c982d6a647a29fa4ae9b6a14 (diff)
[dhcpv6] Solicit messages derive default IAID from MAC address
IAID must be set by the client. This patch generates the IAID from the MAC address of the interface. To do so, a new WithIAID modifier is added, the interface of NewSolicitWithCID now requires a hwaddr parameter, and NewAdvertiseFromSolicit copies the IA_NA option from the solicit if present. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
Diffstat (limited to 'dhcpv6/async/client_test.go')
-rw-r--r--dhcpv6/async/client_test.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/dhcpv6/async/client_test.go b/dhcpv6/async/client_test.go
index 9b58112..8603248 100644
--- a/dhcpv6/async/client_test.go
+++ b/dhcpv6/async/client_test.go
@@ -8,7 +8,6 @@ import (
"github.com/insomniacslk/dhcp/dhcpv6"
"github.com/insomniacslk/dhcp/dhcpv6/client6"
- "github.com/insomniacslk/dhcp/iana"
"github.com/stretchr/testify/require"
)
@@ -20,13 +19,7 @@ func solicit(input string) (*dhcpv6.Message, error) {
if err != nil {
return nil, err
}
- duid := dhcpv6.Duid{
- Type: dhcpv6.DUID_LLT,
- HwType: iana.HWTypeEthernet,
- Time: dhcpv6.GetTime(),
- LinkLayerAddr: mac,
- }
- return dhcpv6.NewSolicitWithCID(duid)
+ return dhcpv6.NewSolicit(mac)
}
// server creates a server which responds with a predefined response