From ea50066badf343aa178487ef4f545e4aa52d8029 Mon Sep 17 00:00:00 2001 From: Chris K Date: Sun, 27 Jan 2019 02:47:19 -0800 Subject: [PATCH] dhcpv6: use new TransactionID type (#21) --- internal/dhcp6/dhcp6.go | 6 +++--- internal/dhcp6/dhcp6_test.go | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/dhcp6/dhcp6.go b/internal/dhcp6/dhcp6.go index 826fd00..a89b999 100644 --- a/internal/dhcp6/dhcp6.go +++ b/internal/dhcp6/dhcp6.go @@ -45,8 +45,8 @@ type ClientConfig struct { // be able to carry it around between devices. DUID []byte - Conn net.PacketConn // for testing - TransactionIDs []uint32 // for testing + Conn net.PacketConn // for testing + TransactionIDs []dhcpv6.TransactionID // for testing } // Config contains the obtained network configuration. @@ -67,7 +67,7 @@ type Client struct { err error Conn net.PacketConn // TODO: unexport - transactionIDs []uint32 + transactionIDs []dhcpv6.TransactionID ReadTimeout time.Duration WriteTimeout time.Duration diff --git a/internal/dhcp6/dhcp6_test.go b/internal/dhcp6/dhcp6_test.go index a0e0cbe..a59a038 100644 --- a/internal/dhcp6/dhcp6_test.go +++ b/internal/dhcp6/dhcp6_test.go @@ -22,6 +22,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/insomniacslk/dhcp/dhcpv6" "github.com/rtr7/router7/internal/testing/pcapreplayer" ) @@ -46,9 +47,9 @@ func TestDHCP6(t *testing.T) { InterfaceName: "lo", LocalAddr: laddr, Conn: conn, - TransactionIDs: []uint32{ - 0x48e59e, // SOLICIT - 0x738c3b, // REQUEST + TransactionIDs: []dhcpv6.TransactionID{ + {0x48, 0xe5, 0x9e}, // SOLICIT + {0x73, 0x8c, 0x3b}, // REQUEST }, }) if err != nil {