dhcpv6: use new TransactionID type (#21)

This commit is contained in:
Chris K 2019-01-27 02:47:19 -08:00 committed by Michael Stapelberg
parent a3799c4ec5
commit ea50066bad
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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 {