summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/async
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2019-04-23 09:24:48 +0100
committerAndrea Barberio <insomniac@slackware.it>2019-04-23 20:05:31 +0100
commitb071bdc86a58037f6c745647c97fca202f3caef9 (patch)
treea64975a795bad93f7e58256cfecdb01aaf45067f /dhcpv6/async
parentef6ad8a08ce25eeca699f984c59062c6ca107ee1 (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')
-rw-r--r--dhcpv6/async/client_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/dhcpv6/async/client_test.go b/dhcpv6/async/client_test.go
index 9b58112..a3b076c 100644
--- a/dhcpv6/async/client_test.go
+++ b/dhcpv6/async/client_test.go
@@ -26,7 +26,7 @@ func solicit(input string) (*dhcpv6.Message, error) {
Time: dhcpv6.GetTime(),
LinkLayerAddr: mac,
}
- return dhcpv6.NewSolicitWithCID(duid)
+ return dhcpv6.NewSolicitWithCID(duid, mac, dhcpv6.WithIAID([4]byte{1, 2, 3, 4}))
}
// server creates a server which responds with a predefined response