diff options
author | Andrea Barberio <insomniac@slackware.it> | 2017-12-07 00:10:05 +0000 |
---|---|---|
committer | Andrea Barberio <insomniac@slackware.it> | 2017-12-07 00:10:05 +0000 |
commit | f5d849e1e72d2b92136eadc66a82cad83f8bac91 (patch) | |
tree | 4980eebf315548abee44151125936f8d31bdbce6 /dhcpv6/dhcpv6message.go | |
parent | 13f86883b764b61a15bbcd2914d09541572866ee (diff) |
Relay message options instead of a raw byte sequence
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r-- | dhcpv6/dhcpv6message.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go index 4461c50..f1ba601 100644 --- a/dhcpv6/dhcpv6message.go +++ b/dhcpv6/dhcpv6message.go @@ -106,9 +106,14 @@ func (d *DHCPv6Message) Type() MessageType { } func (d *DHCPv6Message) SetMessage(messageType MessageType) { - if d.MessageTypeToString() == "" { + msgString := MessageTypeToString(messageType) + if msgString == "" { log.Printf("Warning: unknown DHCPv6 message type: %v", messageType) } + if messageType == RELAY_FORW || messageType == RELAY_REPL { + log.Printf("Warning: using a RELAY message type with a non-relay message: %v (%v)", + msgString, messageType) + } d.messageType = messageType } |