summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv6/dhcpv6.go15
1 files changed, 4 insertions, 11 deletions
diff --git a/dhcpv6/dhcpv6.go b/dhcpv6/dhcpv6.go
index 41b4726..a8f7bdc 100644
--- a/dhcpv6/dhcpv6.go
+++ b/dhcpv6/dhcpv6.go
@@ -1,7 +1,6 @@
package dhcpv6
import (
- "errors"
"fmt"
"net"
"strings"
@@ -223,15 +222,9 @@ func IsUsingUEFI(msg *Message) bool {
// GetTransactionID returns a transactionID of a message or its inner message
// in case of relay
func GetTransactionID(packet DHCPv6) (TransactionID, error) {
- if message, ok := packet.(*Message); ok {
- return message.TransactionID, nil
- }
- if relay, ok := packet.(*RelayMessage); ok {
- message, err := relay.GetInnerMessage()
- if err != nil {
- return TransactionID{0, 0, 0}, err
- }
- return GetTransactionID(message)
+ m, err := packet.GetInnerMessage()
+ if err != nil {
+ return TransactionID{0, 0, 0}, err
}
- return TransactionID{0, 0, 0}, errors.New("Invalid DHCPv6 packet")
+ return m.TransactionID, nil
}