summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv6/dhcpv6message.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go
index 7d96ce3..a4da0a4 100644
--- a/dhcpv6/dhcpv6message.go
+++ b/dhcpv6/dhcpv6message.go
@@ -354,10 +354,11 @@ func NewRequestFromAdvertise(adv *Message, modifiers ...Modifier) (*Message, err
return nil, fmt.Errorf("The passed ADVERTISE must have ADVERTISE type set")
}
// build REQUEST from ADVERTISE
- req := &Message{
- MessageType: MessageTypeRequest,
- TransactionID: adv.TransactionID,
+ req, err := NewMessage()
+ if err != nil {
+ return nil, err
}
+ req.MessageType = MessageTypeRequest
// add Client ID
cid := adv.GetOneOption(OptionClientID)
if cid == nil {