diff options
author | Pablo Mazzini <pmazzini@gmail.com> | 2018-08-13 11:57:15 +0200 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2018-08-13 11:57:15 +0200 |
commit | 5016b923e14e31dc332f329d36398718f7d7a3d5 (patch) | |
tree | 05a3e50dd9b7a658456c6e6bce3534ed1994f3d5 | |
parent | 72d70d68dfcbdbe112d9f82ead6d987898417f95 (diff) |
rebase
-rw-r--r-- | dhcpv6/dhcpv6.go | 10 | ||||
-rw-r--r-- | dhcpv6/dhcpv6_test.go | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/dhcpv6/dhcpv6.go b/dhcpv6/dhcpv6.go index d82ed4a..9382334 100644 --- a/dhcpv6/dhcpv6.go +++ b/dhcpv6/dhcpv6.go @@ -5,6 +5,8 @@ import ( "fmt" "net" "strings" + + "github.com/insomniacslk/dhcp/iana" ) type DHCPv6 interface { @@ -222,9 +224,11 @@ func IsUsingUEFI(msg DHCPv6) bool { // 9 EFI x86-64 if opt := msg.GetOneOption(OptionClientArchType); opt != nil { optat := opt.(*OptClientArchType) - // TODO investigate if other types are appropriate - if optat.ArchType == EFI_BC || optat.ArchType == EFI_X86_64 { - return true + for _, at := range optat.ArchTypes { + // TODO investigate if other types are appropriate + if at == iana.EFI_BC || at == iana.EFI_X86_64 { + return true + } } } if opt := msg.GetOneOption(OptionUserClass); opt != nil { diff --git a/dhcpv6/dhcpv6_test.go b/dhcpv6/dhcpv6_test.go index 812d284..6840252 100644 --- a/dhcpv6/dhcpv6_test.go +++ b/dhcpv6/dhcpv6_test.go @@ -218,14 +218,14 @@ func TestNewMessageTypeSolicitWithCID(t *testing.T) { func TestIsUsingUEFIArchTypeTrue(t *testing.T) { msg := DHCPv6Message{} - opt := OptClientArchType{ArchType: EFI_BC} + opt := OptClientArchType{ArchTypes: []iana.ArchType{iana.EFI_BC}} msg.AddOption(&opt) require.True(t, IsUsingUEFI(&msg)) } func TestIsUsingUEFIArchTypeFalse(t *testing.T) { msg := DHCPv6Message{} - opt := OptClientArchType{ArchType: INTEL_X86PC} + opt := OptClientArchType{ArchTypes: []iana.ArchType{iana.INTEL_X86PC}} msg.AddOption(&opt) require.False(t, IsUsingUEFI(&msg)) } |