summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6message.go
diff options
context:
space:
mode:
authorChris Koch <chrisko@google.com>2023-02-18 23:55:40 -0800
committerChris K <c@chrisko.ch>2023-02-19 13:39:52 -0800
commit93dbaf95ae931da311e1671fd0f470f2aa5f6980 (patch)
tree9e316e50ebcece3b96f0c4261c63d32af8fa2c32 /dhcpv6/dhcpv6message.go
parentf51b4d4530334a45ccb40368ada7930d269ef44a (diff)
dhcpv6: proper DUID types
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r--dhcpv6/dhcpv6message.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go
index 17f371a..8886c6c 100644
--- a/dhcpv6/dhcpv6message.go
+++ b/dhcpv6/dhcpv6message.go
@@ -32,21 +32,21 @@ func (mo MessageOptions) ArchTypes() iana.Archs {
}
// ClientID returns the client identifier option.
-func (mo MessageOptions) ClientID() *Duid {
+func (mo MessageOptions) ClientID() DUID {
opt := mo.GetOne(OptionClientID)
if opt == nil {
return nil
}
- return &opt.(*optClientID).Duid
+ return opt.(*optClientID).DUID
}
// ServerID returns the server identifier option.
-func (mo MessageOptions) ServerID() *Duid {
+func (mo MessageOptions) ServerID() DUID {
opt := mo.GetOne(OptionServerID)
if opt == nil {
return nil
}
- return &opt.(*optServerID).Duid
+ return opt.(*optServerID).DUID
}
// IANA returns all Identity Association for Non-temporary Address options.
@@ -347,9 +347,8 @@ func GetTime() uint32 {
// NewSolicit creates a new SOLICIT message, using the given hardware address to
// derive the IAID in the IA_NA option.
func NewSolicit(hwaddr net.HardwareAddr, modifiers ...Modifier) (*Message, error) {
- duid := Duid{
- Type: DUID_LLT,
- HwType: iana.HWTypeEthernet,
+ duid := &DUIDLLT{
+ HWType: iana.HWTypeEthernet,
Time: GetTime(),
LinkLayerAddr: hwaddr,
}